upnpsoap: Use magic container sort order.

Magic containers can have a pre-defined sort order.  Let's use it by default if
it exists.
This commit is contained in:
Justin Maggard 2015-07-30 15:10:03 -07:00
parent 5a309fc48f
commit b78c25f260

View File

@ -1298,6 +1298,8 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
refid_sql = magic->refid_sql;
if (magic->where)
strncpyt(where, magic->where, sizeof(where));
if (magic->orderby && !GETFLAG(DLNA_STRICT_MASK))
orderBy = strdup(magic->orderby);
if (magic->max_count > 0)
{
int limit = MAX(magic->max_count - StartingIndex, 0);
@ -1313,7 +1315,7 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
if (!totalMatches)
totalMatches = get_child_count(ObjectID, magic);
ret = 0;
if( SortCriteria )
if (SortCriteria && !orderBy)
{
__SORT_LIMIT
orderBy = parse_sort_criteria(SortCriteria, &ret);