From 9bafa0fb4371027ee34b0ffa64b6973db552ae1a Mon Sep 17 00:00:00 2001 From: LOSSES Don <1384036+Losses@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:07:55 +0800 Subject: [PATCH] fix: Seeking is not working --- playback/src/internal.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playback/src/internal.rs b/playback/src/internal.rs index 04597f873..7a1bb075d 100644 --- a/playback/src/internal.rs +++ b/playback/src/internal.rs @@ -5,6 +5,7 @@ use std::sync::{Arc, Mutex}; use anyhow::{anyhow, bail, Context, Result}; use log::{debug, error, info, warn}; +use rodio::source::SeekError; use rodio::{Decoder, PlayError, Sink, Source}; use tokio::sync::mpsc; use tokio::time::{interval, sleep_until, Duration, Instant}; @@ -164,6 +165,10 @@ impl Source for SharedSource { fn total_duration(&self) -> Option { self.inner.lock().unwrap().total_duration() } + + fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> { + self.inner.lock().unwrap().try_seek(pos) + } } pub(crate) struct PlayerInternal {