Improvement: Display TV Show specials in logical order inside seasons#1468
Improvement: Display TV Show specials in logical order inside seasons#1468wutschel wants to merge 3 commits intoxbmc:masterfrom
Conversation
|
btw, I am quite sure this also fixes potential sorting problems with episodes. I have seen while testing this PR, that sometimes the order of episodes was wrong. |
Review timed out before producing output. Retry skipped due to frequent timeouts for this repo/author. |
|
|
||
| // Use TV Show episode's "specialsort", if present, to place a copy of a special | ||
| // within the common seasons. This is in line with Kodi behaviour. | ||
| if ([methodName isEqualToString:@"VideoLibrary.GetEpisodes"]) { |
There was a problem hiding this comment.
would be great to move this logic to the caller instead of having special case right inside the generic method. You could add an optional callback (block) that would allow modifying newDict.
There was a problem hiding this comment.
Hmm, there are anyway several special cases in there (recordings, movie sets, empty TV shows, pvr/timers). I agree, this is not optimal, but I would rather not touch this now.
There was a problem hiding this comment.
OK, can be done later
| } | ||
| else if (![season intValue] && [episode intValue]) { | ||
| // Special episode | ||
| text = [NSString stringWithFormat:@"S%i", [episode intValue]]; |
There was a problem hiding this comment.
Introduced the helper method formatTVShowStringForSpecialEpisode for this now.
Available since Kodi 12 (Frodo).
Check for >0 to cover Kodi versions which defaulted to 0. Adds a copy using the "special sort" attributes. Items are enriched with "Sx" track number scheme and a flag to support sorting in right order. This way specials show under "Specials" (season 0) as well as sorted into the seasons.
ecad34a to
0072413
Compare
|
Anything left open? I rebased to master to keep this up to date. |
Description
Closes #57.
Usually, TV Show specials are listed under season 0. Many TV Shows have special episodes which are important to watch in logical order, ex. "Doctor Who". Kodi is able to display special episodes in both season 0 and in the correct place inside the common seasons. This PR implements the same functionality based on information shared within #57 and links provided from there.
To allow correct logical sorting, the Kodi API shares
specialsortseasonandspecialsortepisode, which represent the logical position of the special episode inside the common seasons. The app does now request this information toshow special episodes in both season 0 and the logical position. 3-staged sorting is applied to ensure the special episodes are added in correct order to the desired position.
To differentiate special episodes from common episodes the naming convention for track numbers and episode IDs is adapted. It follows Kodi's implementation by using "Sx" (x = special episode) which clearly visualizes the type of episode.
Screenshots, suing dummy database with episodes from "Doctor Who":

Summary for release notes
Improvement: Display TV Show specials in logical order inside seasons