Add better error handling for Tag reader
This commit is contained in:
@@ -245,7 +245,10 @@ void Organize::ProcessSomeFiles() {
|
||||
}
|
||||
}
|
||||
else if (destination_->source() == Song::Source::Device) {
|
||||
job.cover_image_ = TagReaderClient::Instance()->LoadEmbeddedArtAsImageBlocking(task.song_info_.song_.url().toLocalFile());
|
||||
const TagReaderClient::Result result = TagReaderClient::Instance()->LoadEmbeddedArtAsImageBlocking(task.song_info_.song_.url().toLocalFile(), job.cover_image_);
|
||||
if (!result.success()) {
|
||||
qLog(Error) << "Could not save embedded art to" << task.song_info_.song_.url() << result.error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!job.cover_source_.isEmpty()) {
|
||||
|
||||
@@ -415,8 +415,13 @@ SongList OrganizeDialog::LoadSongsBlocking(const QStringList &filenames) {
|
||||
continue;
|
||||
}
|
||||
|
||||
TagReaderClient::Instance()->ReadFileBlocking(filename, &song);
|
||||
if (song.is_valid()) songs << song;
|
||||
const TagReaderClient::Result result = TagReaderClient::Instance()->ReadFileBlocking(filename, &song);
|
||||
if (result.success() && song.is_valid()) {
|
||||
songs << song;
|
||||
}
|
||||
else {
|
||||
qLog(Error) << "Could not read file" << filename << result.error;
|
||||
}
|
||||
}
|
||||
|
||||
return songs;
|
||||
|
||||
Reference in New Issue
Block a user