1
0

Fix some edge-cases and use smaller cover art

This commit is contained in:
ixhbinphoenix
2024-02-13 00:36:30 +01:00
parent 5b4972f03d
commit 8003d98e1e
3 changed files with 26 additions and 17 deletions
+4
View File
@@ -39,6 +39,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let track = metadata.track_name.clone();
let artist = metadata.artist_name.clone();
// TODOO: Change this to the release ID?
let hash_key = format!("{} - {}", &track, &artist);
let cover_art = if cover_cache.contains_key(&hash_key) {
debug!("Got cover art from cache");
@@ -52,12 +53,14 @@ fn main() -> Result<(), Box<dyn Error>> {
Ok(a)
},
Err(e) => {
// TODOOO: Cache 'Permanent' Failures (404)
Err(e)
},
}
};
drpc.set_activity(|act| {
// TODO: Add buttons
let mut t = act.state(artist.clone()).details(track.clone());
match cover_art {
@@ -69,6 +72,7 @@ fn main() -> Result<(), Box<dyn Error>> {
})
},
Err(e) => {
// TODO: Provide backup image, no image looks kind of ugly
debug!("Error fetching cover_art: {}", e);
},
}