Skip to content

Warm CloudDrive WebDAV directories in order#53

Merged
ModerRAS merged 1 commit into
masterfrom
fix/clouddrive-webdav-warmup-chain
Jul 22, 2026
Merged

Warm CloudDrive WebDAV directories in order#53
ModerRAS merged 1 commit into
masterfrom
fix/clouddrive-webdav-warmup-chain

Conversation

@ModerRAS

@ModerRAS ModerRAS commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • warm CloudDrive WebDAV playback paths from the configured root through every ancestor before requesting media
  • apply the same ordered warmup to MLIP poster downloads
  • de-duplicate warmed artwork directories during one import
  • keep ordinary WebDAV behavior unchanged

Example order

  • root: empty path
  • /115open
  • /115open/影音
  • /115open/影音/动漫
  • series directory
  • Season 1
  • then the media GET

Validation

  • focused CloudDriveDirectoryConventionsTest, PlaybackHttpRequestResolverTest, and MlipLibraryIndexImporterTest
  • ./gradlew --console=plain test :app:assembleDebug
  • BUILD SUCCESSFUL
  • git diff --check

Version

Patch release on the existing 2.2 line. Latest stable is v2.2.605; baseAppVersionName remains 2.2.0.

Device status

HK1 ADB is still unauthorized, so no app data was cleared and the APK was not installed on-device.

Summary by CodeRabbit

  • Bug Fixes

    • Improved WebDAV playback startup by warming each parent directory in sequence, helping media load more reliably from nested folders.
    • Improved artwork importing for cloud-drive libraries by preparing all required parent directories before downloading images.
    • Added safeguards so directory preparation failures do not interrupt playback or library scanning.
  • Tests

    • Added coverage for hierarchical WebDAV directory preparation and verified the expected request order.

@coderabbitai

coderabbitai Bot commented Jul 22, 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: a82753ae-166e-4c97-b0ab-8b1c4f46558f

📥 Commits

Reviewing files that changed from the base of the PR and between 2db9a0a and ec972e8.

📒 Files selected for processing (6)
  • core/model/src/main/kotlin/com/miruplay/tv/model/CloudDriveAutomation.kt
  • core/model/src/test/kotlin/com/miruplay/tv/model/CloudDriveDirectoryConventionsTest.kt
  • player-core/src/main/kotlin/com/miruplay/tv/player/PlaybackHttpRequestResolver.kt
  • player-core/src/test/kotlin/com/miruplay/tv/player/PlaybackHttpRequestResolverTest.kt
  • scanner/src/main/kotlin/com/miruplay/tv/scanner/MlipLibraryIndexImporter.kt
  • scanner/src/test/kotlin/com/miruplay/tv/scanner/MlipLibraryIndexImporterTest.kt

📝 Walkthrough

Walkthrough

Changes

The change adds a shared WebDAV directory-prefix utility and updates playback request resolution and artwork importing to warm every directory from the root through the target parent, with tests covering path generation, call order, deduplication, and expected listings.

WebDAV warmup

Layer / File(s) Summary
Directory chain contract
core/model/src/main/kotlin/.../CloudDriveAutomation.kt, core/model/src/test/.../CloudDriveDirectoryConventionsTest.kt
Adds webDavDirectoryWarmupChain, which returns cumulative normalized directory prefixes beginning with the root entry, with tests for empty and nested paths.
Playback WebDAV warmup
player-core/src/main/kotlin/.../PlaybackHttpRequestResolver.kt, player-core/src/test/.../PlaybackHttpRequestResolverTest.kt
Playback lists each computed directory in order, handles per-directory failures, closes the media source, and verifies the ordered calls.
Artwork import warmup
scanner/src/main/kotlin/.../MlipLibraryIndexImporter.kt, scanner/src/test/.../MlipLibraryIndexImporterTest.kt
Artwork caching tracks warmed directories for default cloud-drive WebDAV sources, warms unseen prefixes, and expects root plus parent directory listings.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlaybackHttpRequestResolver
  participant webDavDirectoryWarmupChain
  participant MediaSource
  PlaybackHttpRequestResolver->>webDavDirectoryWarmupChain: Compute directory prefixes
  webDavDirectoryWarmupChain-->>PlaybackHttpRequestResolver: Return root-to-parent chain
  loop Each directory
    PlaybackHttpRequestResolver->>MediaSource: listFiles(directory)
  end
  PlaybackHttpRequestResolver->>MediaSource: close()
Loading
sequenceDiagram
  participant MlipLibraryIndexImporter
  participant webDavDirectoryWarmupChain
  participant MediaSource
  MlipLibraryIndexImporter->>webDavDirectoryWarmupChain: Compute artwork directory prefixes
  webDavDirectoryWarmupChain-->>MlipLibraryIndexImporter: Return root-to-parent chain
  loop Each unwarmed directory
    MlipLibraryIndexImporter->>MediaSource: listFiles(directory)
  end
Loading
✨ 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/clouddrive-webdav-warmup-chain

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 8192a71 into master Jul 22, 2026
3 of 4 checks passed
@ModerRAS
ModerRAS deleted the fix/clouddrive-webdav-warmup-chain branch July 22, 2026 16:39
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