Repository navigation
fix(scanner): leave a music video out of the walk - #450
Conversation
Signed-off-by: InstaZDLL <github.105mh@8shield.net>
Signed-off-by: InstaZDLL <github.105mh@8shield.net>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
PR 1 of RFC-029, decision 4. It fixes a defect present today.
The defect
mp4is an audio extension, and rightly so: an.mp4often holds nothing but AAC. A music video placed beside its song, asAlbum/Song.mp4next toAlbum/Song.flacor inAlbum/Clips/, was therefore indexed as a second track whose audio was the clip's soundtrack. The desktop fixed the same defect in its own walk, in v2.1.0.The change
discover_audiodrops the clips with the core's ownscanner::clips::drop_clips. It runs it on the catalogue names, which are the folders as the library shows them, and confirms each candidate withfile_has_video_track. The rule is the desktop's, not a copy of it:.mp4goes only when a file of its name sits beside it, or above itsClipsfolder, and it holds a moving picture;.mp4stays a track whatever its neighbours;.webmor.mkvis not an audio extension and never reaches the walk, so it cannot turn its namesake.mp4into a clip. This is the split between the two sets that the RFC review asked for.normalised_scopetreats aClipsfolder as the folder above it (RFC-029 decision 3, moved forward into this PR). The watcher scopes a scan to the folder where a change happened. A clip dropped intoAlbum/Clips/is told apart from a track only by the song inAlbum/, so a scan of theClipsfolder alone would have indexed it. AClipsfolder at the root means the whole library.What it changes for an existing catalogue
A video already indexed as a track is no longer in the walk. The next scan handles it like a deleted file: unavailable, then purged under the library's rules, with its favourites, ratings, plays and playlist entries. The CHANGELOG says so in those words.
Tests
tests/scanner/music_videos.rs, three tests:Clips/are dropped; an audio.mp4beside its song, a lone video, and a video.mp4beside a.webmof its name all stay tracks;Album/ClipswalksAlbum.a_scope_is_plain_folders_or_the_whole_librarychecks that aClipsfolder becomes its parent whatever its case, thatClipsat the root means the whole library, and thatClips Liveis not aClipsfolder.drop_clipscall, all three tests fail;true, the first test fails onAudio.mp4.cargo fmt,clippy -D warnings,cargo doc -D warningsandcheck-rust-layout.shpass, andcargo test --all-featuresruns 849 passed, 0 failed.Summary by CodeRabbit
Corrections
Clipsdéclenchent l’analyse de son dossier parent. Un dossierClipssitué à la racine entraîne l’analyse de toute la bibliothèque.Documentation