Skip to content

feat: add official anime season structure - #568

Draft
Leyto59 wants to merge 1 commit into
ProdigyV21:mainfrom
Leyto59:feat/anime-season-structure
Draft

feat: add official anime season structure#568
Leyto59 wants to merge 1 commit into
ProdigyV21:mainfrom
Leyto59:feat/anime-season-structure

Conversation

@Leyto59

@Leyto59 Leyto59 commented Aug 14, 2026

Copy link
Copy Markdown

ARVIO-ANIME-001 — Official Anime Season Structure

Summary

This change separates an anime episode's user-facing identity from its canonical identity. The UI can display official ARM/Kitsu seasons without changing the coordinates used by TMDB, Trakt, and watch history.

Each episode can carry:

  • display season and episode numbers;
  • canonical TMDB season and episode numbers;
  • Kitsu ID and episode number for anime source lookup.

Movies and non-anime TV shows keep their existing behavior.

Behavior

  • Uses the existing anime detection: Japanese animation or a known anime mapping.
  • Resolves TMDB shows to Kitsu entries through ARM.
  • Retrieves Kitsu episode counts dynamically.
  • Builds official seasons only when provider data is complete and consistent.
  • Sequentially distributes episodes when TMDB merges several official anime seasons into one container and the episode totals match exactly.
  • Falls back immediately to the existing TMDB structure when ARM/Kitsu fails or returns contradictory data.
  • Displays season-local episode numbers for long-running anime whose TMDB seasons use absolute episode numbering.
  • Uses the exact Kitsu identity for anime addon source lookup when available.
  • Keeps playback tracking, history, progress, and Trakt operations on the canonical TMDB identity.

Why not simply replace season and episode numbers?

A global number replacement would break the identifiers expected by Trakt, TMDB, resume handling, and some addons. The dual-identity model lets every subsystem use the appropriate coordinates: official season numbering for the user, canonical TMDB coordinates for tracking, and Kitsu coordinates for anime addons.

Files changed

  • app/src/main/kotlin/com/arflix/tv/util/AnimeSeasonStructure.kt
  • app/src/main/kotlin/com/arflix/tv/util/AnimeMapper.kt
  • app/src/main/kotlin/com/arflix/tv/data/model/Models.kt
  • app/src/main/kotlin/com/arflix/tv/data/repository/StreamRepository.kt
  • app/src/main/kotlin/com/arflix/tv/ui/screens/details/DetailsViewModel.kt
  • app/src/main/kotlin/com/arflix/tv/ui/screens/details/DetailsScreen.kt
  • app/src/main/kotlin/com/arflix/tv/navigation/AppNavigation.kt
  • app/src/main/kotlin/com/arflix/tv/ui/screens/player/PlayerScreen.kt
  • app/src/test/kotlin/com/arflix/tv/util/AnimeSeasonStructureTest.kt

Validation completed

  • testPlayDebugUnitTest: 308 tests, 0 failures, 0 errors, 1 skipped.
  • assemblePlayDebug: successful.
  • assembleSideloadDebug: successful.
  • git diff --check: successful.
  • Manual Android Pixel test: Rent-a-Girlfriend and My Dress-Up Darling season splitting validated; source lookup and playback validated after the exact Kitsu identity fix.
  • Automated My Dress-Up Darling coverage: a merged 24-episode structure becomes two 12-episode display seasons, and S2E08 retains the Season 2 Kitsu identity.
  • Automated long-running anime handling: absolute canonical episode coordinates remain available while season-local numbering is used for display.

Validation still required from the maintainer

  • Android TV navigation, resume, playback, and season switching.
  • Manual One Piece verification after the season-local display-numbering change.
  • Live Trakt integration: Continue Watching, history, mark as watched, progress, and next episode.
  • ARVIO Cloud authentication and synchronization.

The last two items require the official project's private Trakt and Cloud credentials. Those credentials are not present in the public repository, so these integrations cannot be tested properly from a fork build.

Regression scenarios covered

  • My Dress-Up Darling
  • Rent-a-Girlfriend
  • Mushoku Tensei
  • One Piece and other absolute-numbered shows
  • Naruto and other long-running shows represented by a single anime entry
  • Breaking Bad
  • The Last of Us
  • Game of Thrones
  • TMDB fallback when ARM/Kitsu data is incomplete
  • next-episode resolution across an official season/cour boundary

@github-actions github-actions Bot added the area: android Changes to the Android app or Gradle build label Aug 14, 2026
@ProdigyV21

Copy link
Copy Markdown
Owner

Would be better indeed. Can you show screenshots of it working?

@Leyto59

Leyto59 commented Aug 15, 2026

Copy link
Copy Markdown
Author

Would be better indeed. Can you show screenshots of it working?

Here are some screenshots showing the new implementation working.
Anime season structure is now displayed correctly (Season 2/3/4/5).
Episode mapping remains correct.
Sources are correctly resolved for the selected anime season (example: Rent-a-Girlfriend S05E12).
TMDB mapping is still preserved internally for tracking/playback.

IMG_20260815_215030.jpg

IMG_20260815_215206.jpg

IMG_20260815_215503.jpg

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

Labels

area: android Changes to the Android app or Gradle build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants