Just format the code

This commit is contained in:
Anas Elgarhy 2023-02-19 12:57:16 +02:00
parent 1bd4f7e034
commit a252a0727d
No known key found for this signature in database
GPG key ID: 0501802A1D496528
2 changed files with 15 additions and 17 deletions

View file

@ -48,9 +48,7 @@ fn main() {
&settings.cmus_socket_password, &settings.cmus_socket_password,
); );
#[cfg(feature = "debug")] #[cfg(feature = "debug")]
{
info!("Query command built: {:?}", query_command); info!("Query command built: {:?}", query_command);
}
let mut notification = notify_rust::Notification::new(); let mut notification = notify_rust::Notification::new();
@ -86,18 +84,24 @@ fn main() {
let mut cover_changed = false; let mut cover_changed = false;
match &events[0] { match &events[0] {
CmusEvent::TrackChanged(track) => { CmusEvent::TrackChanged(track) => {
cover = track_cover(&track.path, settings.depth, cover = track_cover(
&track.path,
settings.depth,
settings.force_use_external_cover, settings.force_use_external_cover,
settings.no_use_external_cover); settings.no_use_external_cover,
);
cover_changed = true; cover_changed = true;
} }
_ => { _ => {
if cover == TrackCover::None { if cover == TrackCover::None {
// If the cover is not found, we need to update it. // If the cover is not found, we need to update it.
if let Ok(track) = &previous_response.track() { if let Ok(track) = &previous_response.track() {
cover = track_cover(&track.path, settings.depth, cover = track_cover(
&track.path,
settings.depth,
settings.force_use_external_cover, settings.force_use_external_cover,
settings.no_use_external_cover); settings.no_use_external_cover,
);
cover_changed = true; cover_changed = true;
} }
} }
@ -110,11 +114,7 @@ fn main() {
} }
} }
match notification::show_notification( match notification::show_notification(events, &settings, &mut notification) {
events,
&settings,
&mut notification,
) {
Ok(_) => {} Ok(_) => {}
Err(e) => { Err(e) => {
eprintln!("Error: {}", e); eprintln!("Error: {}", e);

View file

@ -77,9 +77,7 @@ fn build_track_notification(
) -> Result<(), notify_rust::error::Error> { ) -> Result<(), notify_rust::error::Error> {
// Set the summary and body of the notification. // Set the summary and body of the notification.
notification notification
.summary( .summary(process_template_placeholders(&settings.summary, &track).as_str())
process_template_placeholders(&settings.summary, &track).as_str(),
)
.body(process_template_placeholders(&settings.body, &track).as_str()) .body(process_template_placeholders(&settings.body, &track).as_str())
.timeout(settings.timeout as i32 * 1000); .timeout(settings.timeout as i32 * 1000);