Skip to content

Improvement: Display TV Show specials in logical order inside seasons#1468

Open
wutschel wants to merge 3 commits intoxbmc:masterfrom
wutschel:feature_specials
Open

Improvement: Display TV Show specials in logical order inside seasons#1468
wutschel wants to merge 3 commits intoxbmc:masterfrom
wutschel:feature_specials

Conversation

@wutschel
Copy link
Copy Markdown
Collaborator

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 specialsortseason and specialsortepisode, which represent the logical position of the special episode inside the common seasons. The app does now request this information to
show 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":
Bildschirmfoto 2026-04-11 um 18 43 41

Summary for release notes

Improvement: Display TV Show specials in logical order inside seasons

@wutschel
Copy link
Copy Markdown
Collaborator Author

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.

@kodiai
Copy link
Copy Markdown

kodiai Bot commented Apr 11, 2026

Partial review -- timed out after analyzing 0 of 3 files (346s).

Retry skipped -- this repo has timed out frequently for this author.
Consider splitting large PRs to stay within the review timeout budget.

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"]) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, can be done later

Comment thread XBMC Remote/Utilities.m Outdated
}
else if (![season intValue] && [episode intValue]) {
// Special episode
text = [NSString stringWithFormat:@"S%i", [episode intValue]];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy-pasted

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced the helper method formatTVShowStringForSpecialEpisode for this now.

Comment thread XBMC Remote/DetailViewController.m
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.
@wutschel
Copy link
Copy Markdown
Collaborator Author

Anything left open? I rebased to master to keep this up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing episodes in "After season" specials

2 participants