(&mut self, new_time: f64)
| 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 { |
no test coverage detected