about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-23 13:12:24 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-23 13:14:15 +0200
commit2e75681a0569b67c81efc051ea57f56f14c09543 (patch)
treeee8b8885a0cfe8500084507d5487545e6e4d2168
parentfeat(treewide): Use a configuration file (diff)
downloadyt-2e75681a0569b67c81efc051ea57f56f14c09543.tar.gz
yt-2e75681a0569b67c81efc051ea57f56f14c09543.zip
fix(storage/setters): Enforce status invariants
-rw-r--r--src/storage/video_database/setters.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/storage/video_database/setters.rs b/src/storage/video_database/setters.rs
index e2b38e6..76a36a7 100644
--- a/src/storage/video_database/setters.rs
+++ b/src/storage/video_database/setters.rs
@@ -131,7 +131,7 @@ pub async fn set_video_watched(app: &App, video: &Video) -> Result<()> {
     .await?;
 
     if old.status == new_status {
-        return Ok(());
+        unreachable!("The video should not be marked as watched already.")
     }
 
     let now = Utc::now().timestamp();