* Support filtering of the upnp:storageUsed property.
This commit is contained in:
parent
6fcd16985e
commit
a40b085d07
@ -381,6 +381,7 @@ mime_to_ext(const char * mime, char * buf)
|
|||||||
#define FILTER_UPNP_GENRE 0x00040000
|
#define FILTER_UPNP_GENRE 0x00040000
|
||||||
#define FILTER_UPNP_ORIGINALTRACKNUMBER 0x00080000
|
#define FILTER_UPNP_ORIGINALTRACKNUMBER 0x00080000
|
||||||
#define FILTER_UPNP_SEARCHCLASS 0x00100000
|
#define FILTER_UPNP_SEARCHCLASS 0x00100000
|
||||||
|
#define FILTER_UPNP_STORAGEUSED 0x00200000
|
||||||
/* Vendor-specific filter flags */
|
/* Vendor-specific filter flags */
|
||||||
#define FILTER_SEC_CAPTION_INFO_EX 0x01000000
|
#define FILTER_SEC_CAPTION_INFO_EX 0x01000000
|
||||||
#define FILTER_SEC_DCM_INFO 0x02000000
|
#define FILTER_SEC_DCM_INFO 0x02000000
|
||||||
@ -465,6 +466,10 @@ set_filter_flags(char * filter, struct upnphttp *h)
|
|||||||
{
|
{
|
||||||
flags |= FILTER_UPNP_SEARCHCLASS;
|
flags |= FILTER_UPNP_SEARCHCLASS;
|
||||||
}
|
}
|
||||||
|
else if( strcmp(item, "upnp:storageUsed") == 0 )
|
||||||
|
{
|
||||||
|
flags |= FILTER_UPNP_STORAGEUSED;
|
||||||
|
}
|
||||||
else if( strcmp(item, "res") == 0 )
|
else if( strcmp(item, "res") == 0 )
|
||||||
{
|
{
|
||||||
flags |= FILTER_RES;
|
flags |= FILTER_RES;
|
||||||
@ -1061,7 +1066,7 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
"<dc:title>%s</dc:title>"
|
"<dc:title>%s</dc:title>"
|
||||||
"<upnp:class>object.%s</upnp:class>",
|
"<upnp:class>object.%s</upnp:class>",
|
||||||
title, 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 */
|
/* TODO: Implement real folder size tracking */
|
||||||
ret = strcatf(str, "<upnp:storageUsed>%s</upnp:storageUsed>", (size ? size : "-1"));
|
ret = strcatf(str, "<upnp:storageUsed>%s</upnp:storageUsed>", (size ? size : "-1"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user