Skip to content

Make library.db authoritative for MLIP metadata#42

Merged
ModerRAS merged 1 commit into
masterfrom
fix/mlip-authoritative-metadata
Jul 12, 2026
Merged

Make library.db authoritative for MLIP metadata#42
ModerRAS merged 1 commit into
masterfrom
fix/mlip-authoritative-metadata

Conversation

@ModerRAS

@ModerRAS ModerRAS commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • treat library.db as the sole metadata authority for MLIP sources and replace historical local overrides on every scan
  • remove TV/WebUI FILES_ONLY and local-priority controls; block manual and batch metadata writes for MLIP-managed entries
  • preserve user-owned episode/progress-adjacent and Bangumi collection state while refreshing remote metadata
  • invalidate remotely removed MLIP series, propagate cache failures, and replace episode rows transactionally
  • reject MLIP scans on desktop instead of silently treating them as directory scans until a desktop SQLite importer exists

Breaking behavior

  • legacy mlipMetadataMode request/config values remain deserializable but are ignored
  • MLIP metadata corrections must be made in the remote library.db; local re-scraping is no longer available
  • base app version moves from 0.11.0 to 1.0.0 because this changes existing configuration semantics

Validation

  • ./gradlew.bat :core:model:test :data:testDebugUnitTest :scanner:testDebugUnitTest :repository-api:test :repository-desktop:test :sync-engine-shared:test :web-control-core:test :ui-tv:testDebugUnitTest :desktop-app:test :app:assembleDebug :desktop-app:compileKotlin
  • npm run build in web-control/frontend
  • read-only subagent review of core import and exposed metadata-write surfaces
  • HK1 adb install -r, UIAutomator verification of the read-only library.db settings state, and crash-log check

A real HK1 MLIP scan was intentionally not triggered before review to avoid rewriting the current device library without an explicit post-merge action.

Summary by CodeRabbit

  • New Features

    • MLIP-managed metadata is now clearly identified and protected as read-only.
    • Added clearer guidance that corrections must be made remotely before rescanning.
    • Anime searches now include metadata titles and identifiers.
  • Bug Fixes

    • Improved MLIP reimports by preserving viewing progress and other user state.
    • Removed stale cached metadata for series no longer present.
    • Improved episode cache replacement reliability.
  • User Interface

    • Removed the obsolete MLIP metadata-source selection.
    • Rescrape and manual matching actions are unavailable for MLIP-managed content.
    • Desktop scanning now reports unsupported MLIP library imports clearly.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: afb5a2b5-d6d1-4025-8c95-a44a6c6307b2

📥 Commits

Reviewing files that changed from the base of the PR and between f7c3563 and 8b472f5.

📒 Files selected for processing (22)
  • app/build.gradle.kts
  • core/model/src/main/kotlin/com/miruplay/tv/model/MediaSourceInfoConventions.kt
  • core/model/src/test/kotlin/com/miruplay/tv/model/MediaSourceInfoConventionsTest.kt
  • data/src/main/kotlin/com/miruplay/tv/data/dao/EpisodeDao.kt
  • data/src/main/kotlin/com/miruplay/tv/data/repository/MetadataRepositoryImpl.kt
  • desktop-app/src/main/kotlin/com/miruplay/tv/desktop/DesktopSourceScan.kt
  • desktop-app/src/main/kotlin/com/miruplay/tv/desktop/MiruPlayDesktopComposeApp.kt
  • desktop-app/src/test/kotlin/com/miruplay/tv/desktop/DesktopScanIndexIntegrationTest.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/MediaIndexDisplay.kt
  • repository-api/src/main/kotlin/com/miruplay/tv/repository/MetadataBatchPlanner.kt
  • repository-desktop/src/main/kotlin/com/miruplay/tv/repository/desktop/FileBackedMediaIndexRepository.kt
  • repository-desktop/src/test/kotlin/com/miruplay/tv/repository/desktop/DesktopRepositoriesTest.kt
  • scanner/src/main/kotlin/com/miruplay/tv/scanner/MlipLibraryIndexImporter.kt
  • scanner/src/test/kotlin/com/miruplay/tv/scanner/MlipLibraryIndexImporterTest.kt
  • sync-engine-shared/src/main/kotlin/com/miruplay/tv/sync/BangumiIndexMetadataCoordinator.kt
  • sync-engine-shared/src/test/kotlin/com/miruplay/tv/sync/BangumiIndexMetadataCoordinatorTest.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
  • ui-tv/src/main/kotlin/com/miruplay/tv/ui/settings/AddSourceScreen.kt
  • ui-tv/src/test/kotlin/com/miruplay/tv/ui/detail/AnimeDetailViewModelTest.kt
  • web-control-core/src/test/kotlin/com/miruplay/tv/webcontrol/WebControlSourceRequestsTest.kt
  • web-control/frontend/src/App.vue

📝 Walkthrough

Walkthrough

The change makes MLIP library metadata authoritative and read-only, removes legacy MLIP metadata-mode configuration, updates importer caching and invalidation, blocks metadata mutations across platforms, expands desktop index lookup, and raises the fallback application version to 1.0.0.

Changes

MLIP metadata read-only behavior

Layer / File(s) Summary
Remove configurable MLIP metadata mode
core/model/..., ui-tv/src/main/kotlin/.../AddSourceScreen.kt, web-control-core/..., web-control/frontend/...
MLIP metadata mode is no longer stored, selected, or sent; source forms display a read-only library.db message.
Authoritative MLIP import and cache replacement
data/src/main/kotlin/..., scanner/src/main/kotlin/..., scanner/src/test/...
MLIP imports rebuild index data, preserve cached episode state, update metadata, invalidate missing series, and replace episodes transactionally.
Block MLIP metadata mutations
repository-api/..., sync-engine-shared/...
MLIP-managed entries and read-only sources are rejected by metadata apply, undo, review, and clear operations.
Desktop scan and index handling
desktop-app/..., repository-desktop/...
Desktop MLIP scans fail early, sources are wired as read-only, and anime lookup includes metadata identifiers and titles.
Prevent TV manual metadata actions
ui-tv/src/main/kotlin/..., ui-tv/src/test/...
Rescrape controls and manual matching are disabled for MLIP-managed anime and index entries.

Application version baseline

Layer / File(s) Summary
Raise fallback application version
app/build.gradle.kts
The default base application version changes from 0.11.0 to 1.0.0.

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

Sequence Diagram(s)

sequenceDiagram
  participant SourceForm
  participant MlipLibraryIndexImporter
  participant BangumiIndexMetadataCoordinator
  participant AnimeDetailViewModel
  SourceForm->>MlipLibraryIndexImporter: configure MLIP source without metadata mode
  MlipLibraryIndexImporter->>BangumiIndexMetadataCoordinator: expose MLIP-managed metadata
  BangumiIndexMetadataCoordinator-->>AnimeDetailViewModel: return read-only status
  AnimeDetailViewModel-->>SourceForm: disable rescrape and manual matching
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mlip-authoritative-metadata

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.

@ModerRAS ModerRAS merged commit 3d3737c into master Jul 12, 2026
10 of 11 checks passed
@ModerRAS ModerRAS deleted the fix/mlip-authoritative-metadata branch July 12, 2026 09:37
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