diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-23 18:25:09 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-24 11:45:12 +0200 |
commit | cc07fd430f5860481d6dd7e9050bf32da11d76ce (patch) | |
tree | 8d6cba95a1522a6bab731e4e839e346cd260605c /src/storage | |
parent | feat(select/display): Also show the video hash when color displaying it (diff) | |
download | yt-cc07fd430f5860481d6dd7e9050bf32da11d76ce.tar.gz yt-cc07fd430f5860481d6dd7e9050bf32da11d76ce.zip |
feat(select/cmds): Add a `watched` command
Otherwise, running `yt select file --done` would mark all your already wached stuff to be watched again.
Diffstat (limited to '')
-rw-r--r-- | src/storage/video_database/mod.rs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/storage/video_database/mod.rs b/src/storage/video_database/mod.rs index da08f8f..2a52bb7 100644 --- a/src/storage/video_database/mod.rs +++ b/src/storage/video_database/mod.rs @@ -107,17 +107,27 @@ pub enum VideoStatus { } impl VideoStatus { + pub const ALL: [Self; 6] = [ + Self::Pick, + VideoStatus::Watch, + VideoStatus::Cached, + VideoStatus::Watched, + VideoStatus::Drop, + VideoStatus::Dropped, + ]; + pub fn as_command(&self) -> &str { // NOTE: Keep the serialize able variants synced with the main `select` function <2024-06-14> + // Also try to ensure, that the strings have the same length match self { - VideoStatus::Pick => "pick", + VideoStatus::Pick => "pick ", - VideoStatus::Watch => "watch", - VideoStatus::Cached => "watch", - VideoStatus::Watched => "watch", + VideoStatus::Watch => "watch ", + VideoStatus::Cached => "watch ", + VideoStatus::Watched => "watched", - VideoStatus::Drop => "drop", - VideoStatus::Dropped => "drop", + VideoStatus::Drop => "drop ", + VideoStatus::Dropped => "drop ", } } |