* Handle @id in SearchCriteria.
This commit is contained in:
parent
66ce695272
commit
2155c25109
14
upnpsoap.c
14
upnpsoap.c
@ -1048,6 +1048,7 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
|
|||||||
{
|
{
|
||||||
SearchCriteria = modifyString(SearchCriteria, """, "\"", 0);
|
SearchCriteria = modifyString(SearchCriteria, """, "\"", 0);
|
||||||
SearchCriteria = modifyString(SearchCriteria, "'", "'", 0);
|
SearchCriteria = modifyString(SearchCriteria, "'", "'", 0);
|
||||||
|
SearchCriteria = modifyString(SearchCriteria, "object.", "", 0);
|
||||||
SearchCriteria = modifyString(SearchCriteria, "derivedfrom", "glob", 1);
|
SearchCriteria = modifyString(SearchCriteria, "derivedfrom", "glob", 1);
|
||||||
SearchCriteria = modifyString(SearchCriteria, "contains", "glob", 1);
|
SearchCriteria = modifyString(SearchCriteria, "contains", "glob", 1);
|
||||||
SearchCriteria = modifyString(SearchCriteria, "dc:title", "d.TITLE", 0);
|
SearchCriteria = modifyString(SearchCriteria, "dc:title", "d.TITLE", 0);
|
||||||
@ -1058,11 +1059,18 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
|
|||||||
SearchCriteria = modifyString(SearchCriteria, "exists true", "is not NULL", 0);
|
SearchCriteria = modifyString(SearchCriteria, "exists true", "is not NULL", 0);
|
||||||
SearchCriteria = modifyString(SearchCriteria, "exists false", "is NULL", 0);
|
SearchCriteria = modifyString(SearchCriteria, "exists false", "is NULL", 0);
|
||||||
SearchCriteria = modifyString(SearchCriteria, "@refID", "REF_ID", 0);
|
SearchCriteria = modifyString(SearchCriteria, "@refID", "REF_ID", 0);
|
||||||
SearchCriteria = modifyString(SearchCriteria, "object.", "", 0);
|
if( strstr(SearchCriteria, "@id") )
|
||||||
#if 0
|
{
|
||||||
|
newSearchCriteria = modifyString(strdup(SearchCriteria), "@id", "OBJECT_ID", 0);
|
||||||
|
SearchCriteria = newSearchCriteria;
|
||||||
|
}
|
||||||
|
#if 0 // Does 360 need this?
|
||||||
if( strstr(SearchCriteria, "&") )
|
if( strstr(SearchCriteria, "&") )
|
||||||
{
|
{
|
||||||
newSearchCriteria = modifyString(strdup(SearchCriteria), "&", "&", 0);
|
if( newSearchCriteria )
|
||||||
|
newSearchCriteria = modifyString(newSearchCriteria, "&", "&", 0);
|
||||||
|
else
|
||||||
|
newSearchCriteria = modifyString(strdup(SearchCriteria), "&", "&", 0);
|
||||||
SearchCriteria = newSearchCriteria;
|
SearchCriteria = newSearchCriteria;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
10
utils.c
10
utils.c
@ -64,7 +64,7 @@ modifyString(char * string, const char * before, const char * after, short like)
|
|||||||
chgcnt++;
|
chgcnt++;
|
||||||
s = p+oldlen;
|
s = p+oldlen;
|
||||||
}
|
}
|
||||||
string = realloc(string, strlen(string)+((newlen-oldlen)*chgcnt)+1);
|
string = realloc(string, strlen(string)+((newlen-oldlen)*chgcnt)+1+like);
|
||||||
}
|
}
|
||||||
|
|
||||||
s = string;
|
s = string;
|
||||||
@ -73,9 +73,11 @@ modifyString(char * string, const char * before, const char * after, short like)
|
|||||||
p = strcasestr(s, before);
|
p = strcasestr(s, before);
|
||||||
if( !p )
|
if( !p )
|
||||||
return string;
|
return string;
|
||||||
|
memmove(p + newlen, p + oldlen, strlen(p + oldlen) + 1);
|
||||||
|
memcpy(p, after, newlen);
|
||||||
if( like )
|
if( like )
|
||||||
{
|
{
|
||||||
t = p+oldlen;
|
t = p+newlen;
|
||||||
while( isspace(*t) )
|
while( isspace(*t) )
|
||||||
t++;
|
t++;
|
||||||
if( *t == '"' )
|
if( *t == '"' )
|
||||||
@ -84,12 +86,8 @@ modifyString(char * string, const char * before, const char * after, short like)
|
|||||||
memmove(t+1, t, strlen(t)+1);
|
memmove(t+1, t, strlen(t)+1);
|
||||||
*t = '*';
|
*t = '*';
|
||||||
}
|
}
|
||||||
memmove(p + newlen, p + oldlen, strlen(p + oldlen) + 1);
|
|
||||||
memcpy(p, after, newlen);
|
|
||||||
s = p + newlen;
|
s = p + newlen;
|
||||||
}
|
}
|
||||||
if( newlen < oldlen )
|
|
||||||
string = realloc(string, strlen(string)+1);
|
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user