diff options
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); - } } |
