Format code
This commit is contained in:
parent
e51c8991ac
commit
33ab0f36a3
1 changed files with 5 additions and 3 deletions
|
@ -60,12 +60,14 @@ async fn get_current(_req: tide::Request<()>) -> tide::Result {
|
||||||
let mut mpd = mpd::connect()?;
|
let mut mpd = mpd::connect()?;
|
||||||
let song = mpd.currentsong()?;
|
let song = mpd.currentsong()?;
|
||||||
|
|
||||||
let mut template = CurrentTemplate { song: song.clone(), name: None };
|
let mut template = CurrentTemplate {
|
||||||
|
song: song.clone(),
|
||||||
|
name: None,
|
||||||
|
};
|
||||||
|
|
||||||
if let Some(song) = song {
|
if let Some(song) = song {
|
||||||
let name = song.title.unwrap_or(song.file.clone()).to_string();
|
let name = song.title.unwrap_or(song.file.clone()).to_string();
|
||||||
template.name = Some(name);
|
template.name = Some(name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(template.into())
|
Ok(template.into())
|
||||||
|
|
Loading…
Reference in a new issue