diff options
author | Justin Maggard <jmaggard@users.sourceforce.net> | 2012-02-14 02:54:31 +0400 |
---|---|---|
committer | Justin Maggard <jmaggard@users.sourceforce.net> | 2012-02-14 02:54:31 +0400 |
commit | a442f504731fef3f6eb51edb82bdbfd8b23037d7 (patch) | |
tree | c742df12f3818249a64cabe453ba82ab50852c97 | |
parent | c3d8b206d33fd54cb5ddb7e11e6b8798959d4544 (diff) |
* Support filtering of the upnp:storageUsed property.
-rw-r--r-- | upnpsoap.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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")); } |