From 669a6882d608c2c12cc8b1ead3f3f1666885d43e Mon Sep 17 00:00:00 2001 From: Steven Vandevelde Date: Sun, 15 Sep 2024 19:16:14 +0200 Subject: [PATCH] fix: Account for changes in duration --- src/Core/UI/Audio/State.elm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Core/UI/Audio/State.elm b/src/Core/UI/Audio/State.elm index 72f77292..ffe0dfe7 100644 --- a/src/Core/UI/Audio/State.elm +++ b/src/Core/UI/Audio/State.elm @@ -28,13 +28,12 @@ durationChange { trackId, duration } = onlyIfMatchesNowPlaying { trackId = trackId } (\nowPlaying -> - case nowPlaying.duration of - Nothing -> - durationChange_ { trackId = trackId, duration = duration } nowPlaying + if nowPlaying.duration == Nothing || nowPlaying.duration /= Just duration then + durationChange_ { trackId = trackId, duration = duration } nowPlaying - Just _ -> - -- Ignore repeating events - Return.singleton + else + -- Ignore repeating events + Return.singleton ) -- 2.51.2