Skip to content

Commit ebbc8cb

Browse files
committed
Fall back to sub per episode, and stop the TV banner rendering undersized
Prefer-dub reported "no server found" on episodes that simply have no dub yet. The fallback asked whether the *title* had any dubbed episode at all, which is true for any long-running show with dubbed early episodes — so a recent, undubbed episode passed the check, every dub server was tried in turn for something none of them had, and the viewer waited out the whole fallback chain to be told nothing was available, for an episode that had subs all along. The check now asks about the episode being opened, matching the prefer-dub upgrade path directly above it, which was already per-episode. The Android TV banner shipped twice: a density-independent XML wrapping the nodpi art, and a 320x180 PNG in drawable-xhdpi. On an xhdpi TV the PNG wins resource resolution and declares itself 160x90dp inside a 320x180dp slot, so the launcher drew the logo undersized. Dropping the duplicate lets the XML (gravity=fill) serve every density. Note the remaining art limitation: the source is 320x180, so it is still upscaled on an xhdpi banner slot. A 640x360 or 1280x720 source would make it sharp; this change only fixes the size it is drawn at.
1 parent 5997a10 commit ebbc8cb

2 files changed

Lines changed: 24 additions & 6 deletions

File tree

app/src/main/java/com/anilili/ui/watch/WatchViewModel.kt

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,31 @@ class WatchViewModel : ViewModel() {
310310
}
311311
}
312312
// The mirror case: launches carrying category=dub (prefer-dub defaults from
313-
// Watch Now, seeded Continue Watching, or stale history) for a title no provider
314-
// dubs. Without this the spine comes up empty and the screen dies with
315-
// "No episodes for this title" even though subs exist.
316-
if (category == Category.DUB && merged.providers.none { it.dub.isNotEmpty() }) {
317-
if (merged.providers.any { it.sub.isNotEmpty() }) {
313+
// Watch Now, seeded Continue Watching, or stale history) where the dub cannot
314+
// actually serve this episode. Without this the spine comes up empty and the
315+
// screen dies with "No episodes for this title" even though subs exist.
316+
//
317+
// Judged per episode, not per title. Dubs routinely lag the sub release, so a
318+
// long-running show has dubbed early episodes and undubbed recent ones: checking
319+
// only "does any dub exist" passed, then every dub server was tried in turn for an
320+
// episode none of them had, and the viewer waited out the whole fallback chain to
321+
// be told "no server found" for something available in sub all along.
322+
if (category == Category.DUB) {
323+
val startNumber = episodeNumber.toDoubleOrNull()
324+
val dubHasEpisode = merged.providers.any { provider ->
325+
provider.dub.isNotEmpty() &&
326+
(startNumber == null || provider.dub.any { it.number == startNumber })
327+
}
328+
val subHasEpisode = merged.providers.any { provider ->
329+
provider.sub.isNotEmpty() &&
330+
(startNumber == null || provider.sub.any { it.number == startNumber })
331+
}
332+
if (!dubHasEpisode && subHasEpisode) {
318333
category = Category.SUB
319-
DiagnosticsLog.event("Watch category fell back to sub (no dub catalog) id=$id")
334+
DiagnosticsLog.event(
335+
"Watch category fell back to sub (no dub for episode) id=$id " +
336+
"episode=$episodeNumber",
337+
)
320338
}
321339
}
322340
repo.animeInfo(id)?.let { info ->
-53.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)