diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-09 19:08:36 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-09 19:08:36 +0200 |
| commit | e3bf6d1dc6e058ddf499557ea92b532086b64fdc (patch) | |
| tree | 4a769ca60e7302857e6f830be40727d409c1e19e /crates | |
| parent | fix(yt/db/videos/comments): Update comment handling to new yt-dlp format (diff) | |
| download | yt-e3bf6d1dc6e058ddf499557ea92b532086b64fdc.zip | |
fix(yt/db/insert/playlist): Always delete a video file, even when marked-picked
Diffstat (limited to '')
| -rw-r--r-- | crates/yt/src/storage/db/insert/playlist.rs | 10 | ||||
| -rw-r--r-- | crates/yt/src/storage/db/insert/video/mod.rs | 10 |
2 files changed, 6 insertions, 14 deletions
diff --git a/crates/yt/src/storage/db/insert/playlist.rs b/crates/yt/src/storage/db/insert/playlist.rs index 26d5376..dd8a9d2 100644 --- a/crates/yt/src/storage/db/insert/playlist.rs +++ b/crates/yt/src/storage/db/insert/playlist.rs @@ -47,10 +47,12 @@ impl Playlist { current_video.title, new_state ); - match new_state { - VideoTransition::Watched => current_video.set_watched(ops), - VideoTransition::Picked => current_video.set_status(VideoStatus::Pick, ops), - } + let new_state = match new_state { + VideoTransition::Watched => VideoStatus::Watched, + VideoTransition::Picked => VideoStatus::Pick, + }; + current_video.remove_download_path(ops); + current_video.set_status(new_state, ops); self.save_watch_progress(mpv, current_index, ops); diff --git a/crates/yt/src/storage/db/insert/video/mod.rs b/crates/yt/src/storage/db/insert/video/mod.rs index da62e37..3c73ae7 100644 --- a/crates/yt/src/storage/db/insert/video/mod.rs +++ b/crates/yt/src/storage/db/insert/video/mod.rs @@ -597,14 +597,4 @@ impl Video { }); } } - - /// Mark this video watched. - /// This will both set the status to `Watched` and the `cache_path` to Null. - /// - /// # Panics - /// Only if assertions fail. - pub(crate) fn set_watched(&mut self, ops: &mut Operations<Operation>) { - self.remove_download_path(ops); - self.set_status(VideoStatus::Watched, ops); - } } |
