Add NoEvents
error for CmusQueryResponse
This commit is contained in:
parent
6d62c66b5f
commit
4773c1c1cd
3 changed files with 3 additions and 7 deletions
|
@ -54,6 +54,8 @@ pub enum CmusError {
|
|||
UnknownAAAMode(String),
|
||||
#[error("Unknown shuffle mode: {0}")]
|
||||
UnknownShuffleMode(String),
|
||||
#[error("No events")]
|
||||
NoEvents,
|
||||
}
|
||||
|
||||
impl FromStr for TrackStatus {
|
||||
|
|
|
@ -51,7 +51,7 @@ impl CmusQueryResponse {
|
|||
if self.track_row.is_empty() || self.player_settings_row.is_empty() {
|
||||
#[cfg(feature = "debug")]
|
||||
info!("Cmus response is empty, returning empty events");
|
||||
return Ok(Vec::new());
|
||||
return Err(CmusError::NoEvents)
|
||||
}
|
||||
|
||||
let mut events = Vec::new();
|
||||
|
|
|
@ -30,12 +30,6 @@ impl NotificationsHandler {
|
|||
events: Vec<CmusEvent>,
|
||||
response: &CmusQueryResponse,
|
||||
) -> Result<(), notify_rust::error::Error> {
|
||||
if events.is_empty() {
|
||||
#[cfg(feature = "debug")]
|
||||
info!("no events to process");
|
||||
return Ok(()); // No events to process.
|
||||
}
|
||||
|
||||
//FIXME: Should check if the user has enabled the cover feature or use a static cover.
|
||||
self.update_cover(&events[0], response);
|
||||
|
||||
|
|
Loading…
Reference in a new issue