From 6b16545ce7b4cb1fe8c029e40e64ebca020f4968 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 22 Aug 2024 14:28:29 +0200 Subject: fix(watch/events): Also mark a video inactive on the stop event --- src/watch/events.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') 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"); -- cgit 1.4.1