From b78c25f260e1a4b8994cdb4f20a0adb9ffbe6435 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Thu, 30 Jul 2015 15:10:03 -0700 Subject: [PATCH] upnpsoap: Use magic container sort order. Magic containers can have a pre-defined sort order. Let's use it by default if it exists. --- upnpsoap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/upnpsoap.c b/upnpsoap.c index aa6eb81..13cb3c1 100644 --- a/upnpsoap.c +++ b/upnpsoap.c @@ -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);