Kodi Community Forum

Full Version: Proposal: More 'natural' ordering for PVR Recorded TV files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all, there is one more bit of trouble I'd like to try and cause everyone for the Matrix PVR interface.  I don't have what I consider to be a good solution so before I waste people's time with a PR I'd like to waste your time explaining it to see if anyone agrees and has alternative ideas about it.

One of the problems I've had with the PVR interface since getting into this is the inherent sorting limitations of the Recorded TV interface.  Today we can sort by Name, Date (actually Date/Time - more on that later), Duration, File, and optionally Size.  The problem I have with these options is that none of them provide the ability to show a series in production order.  Date works OK if the user is able to record the episodes of a series as they air, but for me, and a good portion of my PVR addon users, this really doesn't work in many cases.

For my PVR addon, I give the users a couple ways to combat this:

The first way, and the one I prefer, is an option "Use season/episode number as title for Recordings".  My addon groups series into individual folders, so this works pretty well interface-wise and allows a Name sort to work.  For example, in the folder "TV / Recordings / Bull" instead of a list item titled "Bull (Off the Rails)", the user will see "S04E18 (Off the Rails)".  The primary downside to this, at least using Estuary skin, is that the Player interface will say "S04E18" instead of "Bull" like it should.  The backend might not always have this information available as well, which can cause some undesirable funkiness.

The second way was added for folks that had a lot of programs without season/episode info or just didn't like the first way.  This method replaces the recording date with the original air date, when available.  Seemed like a fine idea when it was suggested to me, but it actually caused some unexpected problems (resolved, eventually), and I've grown to dislike it quite a bit.  Other than programs lacking an original air date, my backend only provides a date not a date/time, so every recording will show up as if it recorded at midnight on that particular day if it works at all.  My users like the option, but it's ugly and clearly appears as a hack.  New users would probably think it's a defect, to be honest Smile

Back in January I proposed a PR to add a sort method for Season/Episode (PR 17264), but that PR failed as @ksooo was spot-on with his analysis that adding a sort method for optional data cannot realistically be made to work.  After getting the strFirstAired field added to PVR Recordings I've also spent a lot of time trying to make a similar sort for "First aired", but the same roadblock is there (it's an optional field and needs to stay that way), and I still wasn't satisfied with the end result.

I truly believe that the available sort methods aren't ideal for Recorded TV, and would really like to remove the weird hacks I have in place, so I would like to propose the following alternate "solution" to either get shot down once and for all, or more hopefully, turned into something viable I could contribute via a PR:
 
  • Change "Date" sort method to display just the date (%J - i.e. 2020.04.07) instead of the date/time, make this the default sort
  • Add a "Date/Time" sort method to replace "Date" (%d - i.e. 2020.04.07 11:16:00PM)
  • Add a "Year" sort method

My opinion is that these changes would allow a PVR addon the flexibility to get Kodi to display the data in the best way possible based on what information the backend provides.  Changing "Date" to %J omits the time component from the sort/display -- I believe that the time component is of little importance in this day and age, and this allows PVR addons to spoof the date if it wants to even if there is no time component available.  Adding "Date/Time" gives the user the flexibility to go back to the way "Date" worked before.  Adding "Year" provides the flexibility for the user to sort/view folders like "Movies" where the calendar date within the year is not necessarily important. If "Year" wasn't specified by the addon, the recordingTime year component can be used as a fallback.

I also think these changes would make sense for "Videos" in general and would probably attempt a PR at that level if anyone thinks this is at all viable.  I don't see how displaying the time component of any video's date is all that interesting for the user, and the addition of "Year" seems like a nice add for all Video library items, since movies specifically are generally rolled up to that granularity.

Tagging @Fuzzard, @phunkyfish, and @emveepee in order to solicit their opinions and ideas -- thank you all!
I still think Kodi needs a S/E sort option but maybe it should be a GUI option as opposed to a sort option.  I have to force S/E into episode name because that is the option that many NextPVR  users want and they want it by default.    I made a detailed and boring video https://www.youtube.com/watch?v=vgQsRVOnl_4 showing this mode on several skins and followed by the default with kodi default fields.  

The time field is noise from a display perspective, but I don't see any reason to not have the sort use the time.  With back to back episodes without S/E information it would be important

For NextPVR I don't populate year for TV shows primarily because it is undefined.   An example look at the TheTVDB or IMDB and the Kodi TV library  There are two shows MacGyver/MacGyver (1985) and MacGyver (2016).   What does MacGyver(2018) mean?  Same for Dr. Who and many other shows.

Shows like The Office and Shameless with simultaneous production years in UK and the US are really bad in all sort situations. 

If you are looking at natural order for recordings I think there is room for improvement in the sort not being a file system sort.  Why should folders filter to the top?  I recently made an example of what happens with one offs and movies on date order when the folder is removed https://imgur.com/a/AkvXNL7 and for a user that is not clear.   There are several advantages to what I call flattening the view, the users sees better meta data, they can play the file directly and the watched indicator is for the file not folder

Martin
Thanks, Martin!

I think I will go ahead and try pushing an updated/reworked PR for this that I hope would be able to handle all the situations reasonably well.  Got side-tracked with some other stuff this week, but it provided time to think a bit more about this and absorb your feedback.

I don't think I would propose the flattened view as part of it, the PVR addon can choose to do that on it's own (I've recently received a request for exactly that, in fact), but I do hope that if/when I think it's ready I can tag you for a review? I've found both your involvement and feedback to be invaluable over the years (wow, it's been years now! LOL).  The problem with the PVRs is that there is really no standard to go on, each one has it's own challenges and limitations, I really don't want to "succeed" with a change that would negatively impact anyone else.
The flattened view is already there it is just on File rather then Name and Date which seems backward to me.  An addon can't control the sorts so I would think if I wanted a system view with folders over file that should be the File View.

Here is an example with https://youtu.be/nXfUQV56tHA  maybe you can see what I mean.

I agree with you about the standards, it is not even clear what a File view is.

Martin
(2020-04-18, 19:55)emveepee Wrote: [ -> ]The flattened view is already there it is just on File rather then Name and Date which seems backward to me.  An addon can't control the sorts so I would think if I wanted a system view with folders over file that should be the File View.

Here is an example with https://youtu.be/nXfUQV56tHA  maybe you can see what I mean.

I agree with you about the standards, it is not even clear what a File view is.

Martin
Understood Smile  Nice video!

I haven't gotten back into this one yet, but I know where the changes need to go.  I'll give it my best shot, but don't expect any easy path to approval Smile
Hi @emveepee, finally getting back around to this, I ran out of stuff on my own project Smile

I think I understand your concern with the as-is.  "File" is keying off of the internal path, which really doesn't make sense to me since neither the user nor the addon has any real control over this.  To me, I think what the user sees is what should be sorted.  Not that it matters much since it will sort the same way, but maybe down the road a change to the internal path format might mess it up.  Being a Windows guy, I guess the "folders over files" method you get with "Name" sort never bothered me much, it's how I expect to see things, and it's pretty consistent throughout Kodi.

To do what I want to try I actually need to add a new sort type (i.e. by date) since the same one can't be used twice with different labels / formats.  My new proposed format would be an "air date" type of thing, where it could look at original air date, year, and the recording date/time to always try and provide something meaningful regardless of what optional fields the PVR sets.  

Since I'll be in there and I really don't believe the core team would go for it (I am always hopeful, though), what would you like to see for the Folder/File options, specifically? I can put them in and see how it goes.  If "Name" was something else, perhaps "Folder", and "File" used the actual display names the user sees, would that help you?  I know I frequently misunderstand your intentions Smile  We try though, right?
S/E is the missing sort nothing else will make up for this missing functionality.   Any attempt to try and achieve that with some date order can fail in various use cases with NextPVR because users will have the ability to insert files.   There is a reason Kodi Plex and Emby scrappers and offline TV show managers use the S/E information in the file and not the airdate format which used to be used for talk shows, that is not a natural filename.

If you like folder over file PVR could be improved if the there was a play button on the folder like there is in in Kodi libraries.   Flattening gives much better control over all the file based operations I just wish it had a date sort.

Martin
@djp952  Did you go forward with anything on this thought? I had a discussion with a user I noted that some problems could be solved by changing the default from the hardcoded SetSortMethod(SortByDate) to a guisettings variable like typical library settings.

The default is ok if you record and watch, but if you collect shows and record out of order or like me you watch later and prefer an ascending order for shows to have the next recording at the top, modifying the default would be useful.

Martin
(2020-10-18, 22:03)emveepee Wrote: [ -> ]@djp952  Did you go forward with anything on this thought? I had a discussion with a user I noted that some problems could be solved by changing the default from the hardcoded SetSortMethod(SortByDate) to a guisettings variable like typical library settings.

The default is ok if you record and watch, but if you collect shows and record out of order or like me you watch later and prefer an ascending order for shows to have the next recording at the top, modifying the default would be useful.

Martin
I did not, I felt that the pain it would cause myself and others to try and push something like this through wasn't worth it.  Thanks to the information you provided, actually, I've found that the as-is "File" view is ideal for me since the metadata that it uses happens to sort in the order that I wanted to see all along.  It includes S/E as part of the sort, I had just never really thought "File" was something worth looking at based on the name Smile

The trick will be finding a reasonable default for PVRs that don't supply all the information.  ksooo rightfully pointed out to me that if the field(s) you're trying to key on are optional at some point you'll end up with a weird unsorted list OR you'll have to go the route of adding all the supporting code and a bSupportsXXX type of new flag for the PVR to indicate that it supports it.  Even then things get wonky if the user has multiple PVRs installed.

I'm all for allowing the addon to choose the best "default" based on what it provides - that would be fantastic!  Personally, I'd also be a real fan of a callback to let the PVR tell Kodi what it can sort by, but that starts messing with the UI design, and at this point would likely need to wait until Kodi "N" ...

Anything I can do to help, let me know my friend!  (But, yeah, I gave up -- can only deal with so much pain in 2020 -- lol)
I am not planning on having the addon choose the default, I was going to let the user select it via either advancedsettings.xml or guisettings.  I will submit it for advanced settings and if the concept is approved I can update it for guisettings, but I don't want to do the extra work up front if it gets rejected or ends up on in a wait state.

Martin
PRs for Season/Episode sorting methods for PVR recordings with any display semantics left to the skin:
Is there a chance of back porting Nexus's version of IPTV Simple to Matrix (bugfix-nightlies)?
In my experience of using Kodi the new version of IPTV Simple is the most significant element of Nexus, and I would love to have it already in Matrix. Even if buggy. I can wait for Nexus to ripen for release, but I am impatient to have the new IPTV Simple right now.