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-file = Open file
|
||||||
open-folder = Open folder
|
open-folder = Open folder
|
||||||
subtitles = Subtitles
|
subtitles = Subtitles
|
||||||
|
unknown-author = Unknown Author
|
||||||
|
untitled = Untitled
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
||||||
|
|
|
||||||
17
src/main.rs
17
src/main.rs
|
|
@ -1289,12 +1289,21 @@ impl Application for App {
|
||||||
.content_fit(ContentFit::ScaleDown)
|
.content_fit(ContentFit::ScaleDown)
|
||||||
.width(Length::Fill),
|
.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));
|
col = col.push(widget::vertical_space(space_s));
|
||||||
//TODO: fallback if title missing
|
if self.mpris_meta.title.is_empty() {
|
||||||
col = col.push(widget::text::title4(&self.mpris_meta.title));
|
col = col.push(widget::text::title4(fl!("untitled")));
|
||||||
for artist in self.mpris_meta.artists.iter() {
|
} else {
|
||||||
col = col.push(widget::text::body(artist));
|
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));
|
col = col.push(widget::vertical_space(space_s));
|
||||||
if !self.mpris_meta.album.is_empty() {
|
if !self.mpris_meta.album.is_empty() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue