Menu

#116 Sort by episode

closed
None
5
2018-01-12
2016-01-10
CharlyAR
No

Hi,

Would it be possible to add the ability to force_sort_criteria by season/episode?

Most nfo file generators create something like this:
<?xml version="1.0" encoding="utf-8"?>
<episodedetails>
  <title>Pilot</title>
  <runtime>2583</runtime>
  <aired>2015-11-08</aired>
  <rating>7.3</rating>
  <season>1</season>
  <episode>1</episode>
[etc]
</episodedetails>

It'd be greate to be able to force the sort criteria by season and episode instead of having all of the mixed.

Thanks!

Discussion

  • Shrimpkin

    Shrimpkin - 2016-01-20

    Here is a simple hack that adds this feature. Use the force_sort_criteria=+upnp:originalTrackNumber to sort. Add the metadata using the xml tags:

    <season>1</season>
    <episode>1</episode>
    
     

    Last edit: Shrimpkin 2016-01-20
  • Mario Lange

    Mario Lange - 2016-01-28

    Hi! I`am struggling with the same problem. This first patch is not working on some clients. In my case a SamsungTV. This one sorts everything back in alphabetic order, even if the patch is applied and database is rescanned.

    I have added a hardcoded patch which works good for me, tested on a big mixed video file database. I`am not a programmer or anything else, so my c coding is maybe worse ;-)

    The patch adds season and episode number to the name itself, if such info is present.

    After applied patch and database rescan the episodes shoud be sorted by name in this way:

    "S01E01 - Series"

    rg

     

    Last edit: Mario Lange 2016-01-28
  • Shrimpkin

    Shrimpkin - 2016-01-29

    There is code posted in the forums to modify titles with alt_title in upnpsoap.c:callback(). Simply modify to use video and samsung client. IMO, it is better to modify in callback than on scan since you will be able to limit title modification to clients that actually need it. Look in patches.

     
  • Nenad Grbic

    Nenad Grbic - 2017-12-19

    Hi, this patch also gve me error..

    root@DietPi:/home/dietpi/minidlna-1.2.1# patch -p1 < episode-sorting.patch
    patching file metadata.c
    Hunk #1 succeeded at 237 with fuzz 2 (offset 9 lines).
    Hunk #2 FAILED at 1555.
    1 out of 2 hunks FAILED -- saving rejects to file metadata.c.rej

    episode-sorting.patch from Shrimpkin

    if you want to update patch can you please add "S" 1 and "E" 1 to be seen when browsing episodes.. thanks

     
  • Justin Maggard

    Justin Maggard - 2018-01-12

    This is implemented in master now. You can set season and episode in the nfo files, and sort by upnp:episodeNumber. We'll also try to glean the season and episode numbers from filenames if they're not set in an nfo file.

    Also, check the upated man page for how to force sort on clients that do their own alphanumeric sorting.

     
  • Justin Maggard

    Justin Maggard - 2018-01-12
    • status: open --> closed
    • assigned_to: Justin Maggard
     

Log in to post a comment.