Fix notify/cover platform config
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user