MCPcopy Create free account
hub / github.com/bajrangCoder/setu / progress_fraction

Method progress_fraction

src/components/audio_player.rs:328–338  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

326 if total.as_millis() == 0 {
327 return 0.0;
328 }
329
330 (self.current_position.as_secs_f32() / total.as_secs_f32()).clamp(0.0, 1.0)
331 } else {
332 0.0
333 }
334 }
335
336 fn audio_format_label(&self) -> &str {
337 let ct = self.content_type.to_lowercase();
338 if ct.contains("mp3") || ct.contains("mpeg") {
339 "MP3"
340 } else if ct.contains("wav") {
341 "WAV"

Callers 1

renderMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected