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:
Rashil Gandhi
2022-01-16 01:39:34 +05:30
committed by GitHub
parent 1a63efa69e
commit f29d263f41
5 changed files with 24 additions and 28 deletions

View File

@@ -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);
}