about summary refs log tree commit diff stats
path: root/src/watch
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-22 14:28:29 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-22 14:28:29 +0200
commit6b16545ce7b4cb1fe8c029e40e64ebca020f4968 (patch)
treef7611e235f3e08b4a4a7b45ac8fc748f4f48e506 /src/watch
parentfix(constants): Don't set a default subtile language (diff)
downloadyt-6b16545ce7b4cb1fe8c029e40e64ebca020f4968.tar.gz
yt-6b16545ce7b4cb1fe8c029e40e64ebca020f4968.zip
fix(watch/events): Also mark a video inactive on the stop event
Diffstat (limited to 'src/watch')
-rw-r--r--src/watch/events.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/watch/events.rs b/src/watch/events.rs
index 815ad28..adb35e5 100644
--- a/src/watch/events.rs
+++ b/src/watch/events.rs
@@ -126,12 +126,17 @@ impl MpvEventHandler {
         match event {
             Event::EndFile(r) => match r {
                 EndFileReason::Eof => {
-                    info!("Mpv reached eof of current video. Marking it watched.");
+                    info!("Mpv reached eof of current video. Marking it inactive.");
+
+                    self.mark_cvideo_inactive(app).await?;
+                }
+                EndFileReason::Stop => {
+                    info!("Mpv stopped current video. Marking it inactive.");
+
+                    // TODO: Should we also mark the video watched? <2024-08-21>
 
-                    self.mark_cvideo_watched(app).await?;
                     self.mark_cvideo_inactive(app).await?;
                 }
-                EndFileReason::Stop => {}
                 EndFileReason::Quit => {
                     info!("Mpv quit. Exiting playback");