MCPcopy Create free account
hub / github.com/Moosync/Moosync / update_time

Method update_time

src/store/player_store.rs:309–321  ·  view source on GitHub ↗
(&mut self, new_time: f64)

Source from the content-addressed store, hash-verified

307
308 #[tracing::instrument(level = "debug", skip(self, new_time))]
309 pub fn update_time(&mut self, new_time: f64) {
310 self.scrobble_time += 0f64.max(new_time - self.data.player_details.current_time);
311 self.data.player_details.current_time = new_time;
312
313 if self.scrobble_time > 20f64 && !self.scrobbled {
314 if let Some(current_song) = self.get_current_song() {
315 self.scrobbled = true;
316 send_extension_event(ExtensionExtraEvent::Scrobble([current_song]));
317 }
318 }
319
320 set_position(new_time);
321 }
322
323 #[tracing::instrument(level = "debug", skip(self))]
324 pub fn get_time(&self) -> f64 {

Callers 1

Calls 3

send_extension_eventFunction · 0.85
set_positionFunction · 0.85
get_current_songMethod · 0.80

Tested by

no test coverage detected