cleanin'
This commit is contained in:
+3
-12
@@ -169,26 +169,17 @@ fn main() -> Result<(), Error> {
|
|||||||
break 'event_loop;
|
break 'event_loop;
|
||||||
}
|
}
|
||||||
Event::TrackChanged(mut metadata) => {
|
Event::TrackChanged(mut metadata) => {
|
||||||
|
// we can't use the event metadata - it's incomplete
|
||||||
::std::thread::sleep(Duration::from_millis(250));
|
::std::thread::sleep(Duration::from_millis(250));
|
||||||
metadata = player.get_metadata().unwrap_or(metadata);
|
metadata = player.get_metadata().unwrap_or(metadata);
|
||||||
|
|
||||||
let mut title = metadata.title().unwrap_or("");
|
let title = metadata.title().unwrap_or("");
|
||||||
info!("--- new track : {} ---", title);
|
info!("--- new track : {} ---", title);
|
||||||
|
|
||||||
if title.is_empty() {
|
if title.is_empty() {
|
||||||
warn!("!!! Spotify is giving us garbage - empty metadata struct !!!");
|
warn!("Empty metadata! Wait for next track...");
|
||||||
|
|
||||||
::std::thread::sleep(Duration::from_millis(250));
|
|
||||||
metadata = player.get_metadata().unwrap_or(metadata);
|
|
||||||
title = metadata.title().unwrap_or("");
|
|
||||||
info!("After metadata reload -> new track : {}", title);
|
|
||||||
|
|
||||||
if title.is_empty() {
|
|
||||||
// wait for next event
|
|
||||||
warn!("Still bad");
|
|
||||||
continue 'event_loop;
|
continue 'event_loop;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let mut skip = !config.allow_by_default;
|
let mut skip = !config.allow_by_default;
|
||||||
let mut confidence = false;
|
let mut confidence = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user