fix(android,ios): the player names the episode, not its file

The header under the episode's numbering showed `Episode::detail`, which
falls back to the file name — `[Judas] Chainsaw Man - S01E01.mkv` on a
phone, where the desktop shows `Dog & Chainsaw`. It now shows the
provider's name for the episode, else the one the file name gave it, and
nothing rather than the file name: the release group's tag is no caption,
and it is what a screenshot of the player would carry away.
This commit is contained in:
nvrl committed 2026-10-29 15:44:55 +01:00
1 parent 79f0d74e1a
commit b5ba59b41d
6 files changed
+60 -4

No files matched your search

+8 -1
View File
@@ -342,12 +342,19 @@ func downloadStatusLine(_ download: RetainedDownload, waitingFor: String? = nil)
}
extension EpisodeRecord {
/// The episode's own name: the provider's, else the one the filename gave
/// it. `nil` rather than the filename, which is a release group's tag and
/// the episode's numbering again.
var shownName: String? {
providerName ?? (detail != name && !detail.isEmpty ? detail : nil)
}
/// What an episode row is headed with: "1. Mother and Children".
///
/// The provider's name for the episode, else the name the filename gave it,
/// else "Episode 1". The bare filename only when none of those exist.
func heading(_ position: Int) -> String {
let named = providerName ?? (detail != name ? detail : nil)
let named = shownName
switch (named, number) {
case let (named?, number?): return "\(number). \(named)"
case let (named?, nil): return named