When loading a CUE from disk that isn't in the library, don't overwrite the metadata of its first song with the metadata from the audio file. Fixes issue 2092

This commit is contained in:
David Sansome 2011-08-27 22:29:35 +01:00
parent 13fc24f6c6
commit 7e0e4e48e4
2 changed files with 8 additions and 1 deletions

View File

@ -303,6 +303,11 @@ void SongLoader::EffectiveSongsLoad() {
for (int i = 0; i < songs_.size(); i++) {
Song& song = songs_[i];
if (song.filetype() != Song::Type_Unknown) {
// Maybe we loaded the metadata already, for example from a cuesheet.
continue;
}
LibraryQuery query;
query.SetColumnSpec("%songs_table.ROWID, " + Song::kColumnSpec);
query.AddWhere("filename", song.url().toEncoded());

View File

@ -971,7 +971,9 @@ void Playlist::UpdateItems(const SongList& songs) {
// Update current items list
for (int i=0; i<items_.size(); i++) {
PlaylistItemPtr item = items_[i];
if (item->Metadata().url() == song.url()) {
if (item->Metadata().url() == song.url() &&
item->Metadata().filetype() == Song::Type_Unknown) {
PlaylistItemPtr new_item;
if (song.id() == -1) {
new_item = PlaylistItemPtr(new SongPlaylistItem(song));