fix: resolve preview clip rel_path against all libraries

PreviewClipGenerator stripped a single base_path, so videos in a
non-primary library ended up with the absolute path as 'relative'.
On Windows, PathBuf::from(preview_clips_dir).join(absolute) replaces
with the absolute path, and .with_extension("mp4") on a .mp4 input
yields the input path — ffmpeg then errors out with 'cannot edit
existing files in place'.

The generator now holds Vec<Library> and strips whichever root
actually contains the video, with separator normalization to match
the rest of the code.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cameron
2026-04-18 10:03:32 -04:00
parent 791cb8a7d1
commit 3613af847f
2 changed files with 28 additions and 13 deletions

View File

@@ -74,8 +74,11 @@ impl AppState {
let video_playlist_manager =
VideoPlaylistManager::new(video_path.clone(), playlist_generator.start());
let preview_clip_generator =
PreviewClipGenerator::new(preview_clips_path.clone(), base_path.clone(), preview_dao);
let preview_clip_generator = PreviewClipGenerator::new(
preview_clips_path.clone(),
libraries_vec.clone(),
preview_dao,
);
Self {
stream_manager,