diff --git a/upnpsoap.c b/upnpsoap.c index 958aea3..e167e69 100644 --- a/upnpsoap.c +++ b/upnpsoap.c @@ -381,6 +381,7 @@ mime_to_ext(const char * mime, char * buf) #define FILTER_UPNP_GENRE 0x00040000 #define FILTER_UPNP_ORIGINALTRACKNUMBER 0x00080000 #define FILTER_UPNP_SEARCHCLASS 0x00100000 +#define FILTER_UPNP_STORAGEUSED 0x00200000 /* Vendor-specific filter flags */ #define FILTER_SEC_CAPTION_INFO_EX 0x01000000 #define FILTER_SEC_DCM_INFO 0x02000000 @@ -465,6 +466,10 @@ set_filter_flags(char * filter, struct upnphttp *h) { flags |= FILTER_UPNP_SEARCHCLASS; } + else if( strcmp(item, "upnp:storageUsed") == 0 ) + { + flags |= FILTER_UPNP_STORAGEUSED; + } else if( strcmp(item, "res") == 0 ) { flags |= FILTER_RES; @@ -1061,7 +1066,7 @@ callback(void *args, int argc, char **argv, char **azColName) "<dc:title>%s</dc:title>" "<upnp:class>object.%s</upnp:class>", title, class); - if( strcmp(class+10, "storageFolder") == 0 ) { + if( (passed_args->filter & FILTER_UPNP_STORAGEUSED) && strcmp(class+10, "storageFolder") == 0 ) { /* TODO: Implement real folder size tracking */ ret = strcatf(str, "<upnp:storageUsed>%s</upnp:storageUsed>", (size ? size : "-1")); }