Skip to content

Import and display MLIP v3 extras#47

Merged
ModerRAS merged 2 commits into
masterfrom
feature/mlip-v3-extras
Jul 14, 2026
Merged

Import and display MLIP v3 extras#47
ModerRAS merged 2 commits into
masterfrom
feature/mlip-v3-extras

Conversation

@ModerRAS

@ModerRAS ModerRAS commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • accept MLIP v3 and import typed series extras without caching them as normal episodes
  • persist extra metadata through Room schema 9 while keeping MLIP v1/v2 compatible
  • show a separate playable extras section and isolate extras from episode counts, Bangumi sync, next playback, and continue watching

Verification

  • ./gradlew test assembleDebug
  • focused MLIP v1/v2/v3 importer, Room migration, poster grouping, resolver, and playback tests
  • full lint still reports pre-existing API/opt-in findings under EarlyStartupDiagnostics.kt and PlayerScreen.kt; CI lint is configured continue-on-error

Summary by CodeRabbit

  • New Features

    • Added support for importing and displaying series extras such as OVAs, specials, openings, endings, and galleries.
    • Added a dedicated extras section on anime detail screens with progress tracking and “EX” labels.
    • Episode counts, poster summaries, playback queues, and continue-watching results now exclude extras.
    • Added support for MLIP v3 extra metadata and validation.
  • Bug Fixes

    • Improved database migration support for existing libraries.
    • Preserved extra metadata and durations during library indexing.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ModerRAS, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b2e779d4-e5d6-43e1-af31-b8785676a06b

📥 Commits

Reviewing files that changed from the base of the PR and between eaee593 and 438053b.

📒 Files selected for processing (6)
  • data/src/test/kotlin/com/miruplay/tv/data/repository/IndexRepositoryImplTest.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/LibraryAnimeResolver.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/MediaIndexRepository.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/PlayableUriResolver.kt
  • repository-api/src/test/kotlin/com/miruplay/tv/repository/LibraryAnimeResolverTest.kt
  • scanner/src/main/kotlin/com/miruplay/tv/scanner/MlipLibraryIndexImporter.kt
📝 Walkthrough

Walkthrough

This PR adds MLIP v3 series-extra import support, persists extra metadata through Room version 9, separates extras from normal episode flows, exposes extra episodes in anime details, and updates the app version from 1.1.0 to 1.2.0.

Changes

Series extras support

Layer / File(s) Summary
Extra metadata persistence and migration
repository-api/..., data/src/main/kotlin/com/miruplay/tv/data/..., data/schemas/..., app/src/main/..., data/src/test/..., app/src/test/...
MediaIndexEntry and Room index entities now store extra kind, ordinal, sort order, and duration. Room version 9 adds migration 8→9, schema coverage, wiring, and round-trip tests.
MLIP v3 extra import
scanner/src/main/kotlin/..., scanner/src/test/kotlin/...
MLIP v3 validation requires the extra table and capability, parses and validates extra records, imports them into the index, reports counts, and tests invalid and compatible database variants.
Repository separation and projection
repository-api/src/main/kotlin/com/miruplay/tv/repository/..., repository-api/src/test/kotlin/...
Extra entries are excluded from episode caches, lookup, playback, and poster counts, while toIndexedExtras projects ordered extra episodes and anime details expose de-duplicated extras.
Anime detail rendering
ui-tv/src/main/kotlin/com/miruplay/tv/ui/detail/...
Extra episode progress is published separately and displayed in a 特典 section with EX badges and extra-specific titles.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: importing and displaying MLIP v3 extras.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/mlip-v3-extras

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@repository-api/src/main/kotlin/com/miruplay/tv/repository/LibraryAnimeResolver.kt`:
- Around line 76-80: Update the merged extras pipeline in LibraryAnimeResolver
so the result of flatMap and distinctBy(Episode::id) is sorted using the
existing extra_kind/extra_sort_order comparator before returning. Add a test
covering extras from multiple related groups and verify the merged ordering.

In
`@repository-api/src/main/kotlin/com/miruplay/tv/repository/MediaIndexRepository.kt`:
- Around line 23-25: Update the episode/extra classification flow in
MediaIndexRepository to handle a null result from MediaExtraKind.fromValue
before any episode or extra helpers use extraKind. Ensure rows with unmapped
extra_kind values are excluded from normal episode counting and episode flows
rather than treated as episodes, while preserving existing behavior for mapped
values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f85b3668-0e7b-4844-90e5-d6da7e8641ea

📥 Commits

Reviewing files that changed from the base of the PR and between a217cfa and eaee593.

📒 Files selected for processing (24)
  • app/build.gradle.kts
  • app/src/main/kotlin/com/miruplay/tv/di/AppModule.kt
  • app/src/test/kotlin/com/miruplay/tv/di/AppModuleTest.kt
  • data/schemas/com.miruplay.tv.data.db.MiruPlayDatabase/9.json
  • data/src/main/kotlin/com/miruplay/tv/data/dao/IndexDao.kt
  • data/src/main/kotlin/com/miruplay/tv/data/db/MiruPlayDatabase.kt
  • data/src/main/kotlin/com/miruplay/tv/data/entity/IndexEntryEntity.kt
  • data/src/main/kotlin/com/miruplay/tv/data/repository/IndexRepositoryImpl.kt
  • data/src/test/kotlin/com/miruplay/tv/data/db/MiruPlayDatabaseMigrationTest.kt
  • data/src/test/kotlin/com/miruplay/tv/data/repository/IndexRepositoryImplTest.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/LibraryAnimeResolver.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/LibraryEpisodeResolver.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/MediaIndexMetadataCache.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/MediaIndexPosterGrouping.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/MediaIndexRepository.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/PlayableUriResolver.kt
  • repository-api/src/test/kotlin/com/miruplay/tv/repository/LibraryEpisodeResolverTest.kt
  • repository-api/src/test/kotlin/com/miruplay/tv/repository/MediaIndexMetadataCacheTest.kt
  • repository-api/src/test/kotlin/com/miruplay/tv/repository/MediaIndexPosterGroupingTest.kt
  • repository-api/src/test/kotlin/com/miruplay/tv/repository/PlayableUriResolverTest.kt
  • scanner/src/main/kotlin/com/miruplay/tv/scanner/MlipLibraryIndexImporter.kt
  • scanner/src/test/kotlin/com/miruplay/tv/scanner/MlipLibraryIndexImporterTest.kt
  • ui-tv/src/main/kotlin/com/miruplay/tv/ui/detail/AnimeDetailScreen.kt
  • ui-tv/src/main/kotlin/com/miruplay/tv/ui/detail/AnimeDetailViewModel.kt

Comment thread repository-api/src/main/kotlin/com/miruplay/tv/repository/LibraryAnimeResolver.kt Outdated
@ModerRAS ModerRAS merged commit a4177dd into master Jul 14, 2026
11 checks passed
@ModerRAS ModerRAS deleted the feature/mlip-v3-extras branch July 14, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant