aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cli.rs6
-rw-r--r--src/storage/video_database/mod.rs22
2 files changed, 22 insertions, 6 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 3883cb1..4e64657 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -234,6 +234,12 @@ pub enum SelectCommand {
shared: SharedSelectionCommandArgs,
},
+ /// Mark the video given by the hash as already watched
+ Watched {
+ #[command(flatten)]
+ shared: SharedSelectionCommandArgs,
+ },
+
/// Open the video URL in Firefox's `timesinks.youtube` profile
Url {
#[command(flatten)]
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 ",
}
}