Support missing metadata, fixes #56
This commit is contained in:
parent
fe143a689f
commit
3466b064e9
2 changed files with 15 additions and 4 deletions
|
|
@ -4,6 +4,8 @@ no-video-or-audio-file-open = No video or audio file open
|
|||
open-file = Open file
|
||||
open-folder = Open folder
|
||||
subtitles = Subtitles
|
||||
unknown-author = Unknown Author
|
||||
untitled = Untitled
|
||||
|
||||
# Context Pages
|
||||
|
||||
|
|
|
|||
17
src/main.rs
17
src/main.rs
|
|
@ -1289,12 +1289,21 @@ impl Application for App {
|
|||
.content_fit(ContentFit::ScaleDown)
|
||||
.width(Length::Fill),
|
||||
);
|
||||
} else {
|
||||
col = col.push(widget::icon::from_name("audio-x-generic-symbolic").size(256));
|
||||
}
|
||||
col = col.push(widget::vertical_space(space_s));
|
||||
//TODO: fallback if title missing
|
||||
col = col.push(widget::text::title4(&self.mpris_meta.title));
|
||||
for artist in self.mpris_meta.artists.iter() {
|
||||
col = col.push(widget::text::body(artist));
|
||||
if self.mpris_meta.title.is_empty() {
|
||||
col = col.push(widget::text::title4(fl!("untitled")));
|
||||
} else {
|
||||
col = col.push(widget::text::title4(&self.mpris_meta.title));
|
||||
}
|
||||
if self.mpris_meta.artists.is_empty() {
|
||||
col = col.push(widget::text::body(fl!("unknown-author")));
|
||||
} else {
|
||||
for artist in self.mpris_meta.artists.iter() {
|
||||
col = col.push(widget::text::body(artist));
|
||||
}
|
||||
}
|
||||
col = col.push(widget::vertical_space(space_s));
|
||||
if !self.mpris_meta.album.is_empty() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue