mirror of
https://github.com/Dummi26/musicdb.git
synced 2025-12-14 11:56:16 +01:00
songs are now required to have an artist. this breaks existing dbfiles!
This commit is contained in:
@@ -122,9 +122,7 @@ impl GuiElemTrait for CurrentSong {
|
||||
let (name, subtext) = if let Some(song) = new_song {
|
||||
if let Some(song) = info.database.get_song(&song) {
|
||||
let sub = match (
|
||||
song.artist
|
||||
.as_ref()
|
||||
.and_then(|id| info.database.artists().get(id)),
|
||||
info.database.artists().get(&song.artist),
|
||||
song.album
|
||||
.as_ref()
|
||||
.and_then(|id| info.database.albums().get(id)),
|
||||
|
||||
@@ -398,7 +398,7 @@ impl QueueSong {
|
||||
GuiElem::new(Label::new(
|
||||
GuiElemCfg::at(Rectangle::from_tuples((sub_offset, 0.57), (1.0, 1.0))),
|
||||
match (
|
||||
song.artist.as_ref().and_then(|id| db.artists().get(id)),
|
||||
db.artists().get(&song.artist),
|
||||
song.album.as_ref().and_then(|id| db.albums().get(id)),
|
||||
) {
|
||||
(None, None) => String::new(),
|
||||
|
||||
@@ -192,7 +192,7 @@ impl<'a> Looper<'a> {
|
||||
location: self.read_line("The songs file is located, relative to the library root, at...").into(),
|
||||
title: self.read_line("The songs title is..."),
|
||||
album: self.read_line_ido("The song is part of the album with the id... (empty for None)"),
|
||||
artist: self.read_line_ido("The song is made by the artist with the id... (empty for None)"),
|
||||
artist: self.read_line_id("The song is made by the artist with the id..."),
|
||||
more_artists: accumulate(|| self.read_line_ido("The song is made with support by other artist, one of which has the id... (will ask repeatedly; leave empty once done)")),
|
||||
cover: self.read_line_ido("The song should use the cover with the id... (empty for None - will default to album or artist cover, if available)"),
|
||||
general: GeneralData::default(),
|
||||
@@ -223,8 +223,8 @@ impl<'a> Looper<'a> {
|
||||
song.album = self.read_line_ido("");
|
||||
}
|
||||
"artist" => {
|
||||
println!("prev: '{}'", song.artist.map_or(String::new(), |v| v.to_string()));
|
||||
song.artist = self.read_line_ido("");
|
||||
println!("prev: '{}'", song.artist);
|
||||
song.artist = self.read_line_id("");
|
||||
}
|
||||
"location" => {
|
||||
println!("prev: '{:?}'", song.location);
|
||||
|
||||
Reference in New Issue
Block a user