Fix notify/cover platform config

This commit is contained in:
Henrik Friedrichsen
2021-07-27 23:04:00 +02:00
parent 51e8fc74cf
commit eb8d9ad294
2 changed files with 5 additions and 4 deletions

View File

@@ -411,7 +411,7 @@ impl Queue {
}
pub fn send_notification(track_name: &str, cover_url: Option<String>) {
#[cfg(feature = "cover")]
#[cfg(all(feature = "notify", feature = "cover"))]
let res = if let Some(u) = cover_url {
// download album cover image
let path = ui::cover::cache_path_for_url(u.to_string());
@@ -430,9 +430,10 @@ pub fn send_notification(track_name: &str, cover_url: Option<String>) {
Notification::new().summary(track_name).show()
};
#[cfg(not(feature = "cover"))]
#[cfg(all(feature = "notify", not(feature = "cover")))]
let res = Notification::new().summary(track_name).show();
#[cfg(feature = "notify")]
if let Err(e) = res {
error!("Failed to send notification cover: {}", e);
}

View File

@@ -292,8 +292,8 @@ impl ViewExt for CoverView {
pub fn cache_path_for_url(url: String) -> PathBuf {
let mut path = crate::config::cache_path("covers");
path.push(url.split("/").last().unwrap());
return path;
path.push(url.split('/').last().unwrap());
path
}
pub fn download(url: String, path: PathBuf) -> Result<(), std::io::Error> {