Menu

#142 Enable magic_container.orderby sorting (Recently Added sorting)

Unstable (example)
closed-accepted
None
1
2015-11-13
2015-04-27
Shrimpkin
No

This fixes a problem with the 'Recently Added' container when force sorting is enabled.

Enables the magic_container[].orderby sql. Currently, only the 'Recently Added' containers have an orderby entry.

This will override any other sorting, including requested sorting by client. I do not know if this will break any clients expecting another sort order.

1 Attachments

Discussion

  • Justin Maggard

    Justin Maggard - 2015-07-30
    • status: open --> closed-accepted
     
  • Evgeniy Bondarenko

    root@NAS:/opt/minidlna-1.1.5# patch -p1 < enable-magic-container-orderby.patch
    patching file upnpsoap.c
    Hunk #1 FAILED at 1298.
    Hunk #2 FAILED at 1313.
    2 out of 2 hunks FAILED -- saving rejects to file upnpsoap.c.rej
    
    cat upnpsoap.c.rej
    --- upnpsoap.c  2015-04-26 22:46:07.897175252 -0700
    +++ upnpsoap.c  2015-04-26 22:48:13.500178030 -0700
    @@ -1298,6 +1298,8 @@
                                    refid_sql = magic->refid_sql;
                            if (magic->where)
                                    strncpyt(where, magic->where, sizeof(where));
    +                       if (magic->orderby)
    +                               ret = xasprintf(&orderBy, magic->orderby);
                            if (magic->max_count > 0)
                            {
                                    int limit = MAX(magic->max_count - StartingIndex, 0);
    @@ -1313,7 +1315,7 @@
                    if (!totalMatches)
                            totalMatches = get_child_count(ObjectID, magic);
                    ret = 0;
    -               if( SortCriteria )
    +               if( SortCriteria && !orderBy )
                    {
                            __SORT_LIMIT
                            orderBy = parse_sort_criteria(SortCriteria, &ret);
    

    This patch will be working on minidlna-1.1.5?

     
  • Shrimpkin

    Shrimpkin - 2015-11-13

    This patch is not needed for v1.1.5.

     

Log in to post a comment.