Remove notifications' dependency on 'cover' (#706)
* Move functions from 'cover' to 'utils' * Remove notify dependency on 'cover' * Enable clipboard and notifications in CI/CD * remove extra newline
This commit is contained in:
10
src/queue.rs
10
src/queue.rs
@@ -410,14 +410,14 @@ impl Queue {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "notify")]
|
||||
pub fn send_notification(track_name: &str, _cover_url: Option<String>) {
|
||||
#[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());
|
||||
let path = crate::utils::cache_path_for_url(u.to_string());
|
||||
|
||||
if !path.exists() {
|
||||
if let Err(e) = ui::cover::download(u.to_string(), path.clone()) {
|
||||
if let Err(e) = crate::utils::download(u.to_string(), path.clone()) {
|
||||
error!("Failed to download cover: {}", e);
|
||||
}
|
||||
}
|
||||
@@ -430,10 +430,6 @@ pub fn send_notification(track_name: &str, _cover_url: Option<String>) {
|
||||
Notification::new().summary(track_name).show()
|
||||
};
|
||||
|
||||
#[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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user