mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-01 10:06:43 +01:00
Update non collection songs with manually unset cover
This commit is contained in:
parent
2e34abfc0d
commit
7d1fac44e9
@ -315,7 +315,7 @@ AlbumCoverLoader::TryLoadResult AlbumCoverLoader::TryLoadImage(Task *task) {
|
|||||||
!task->options.scale_output_image_ &&
|
!task->options.scale_output_image_ &&
|
||||||
!task->options.pad_output_image_) {
|
!task->options.pad_output_image_) {
|
||||||
task->song.InitArtManual();
|
task->song.InitArtManual();
|
||||||
if (task->art_manual != task->song.art_manual()) {
|
if (task->song.art_manual_is_valid() && task->art_manual != task->song.art_manual()) {
|
||||||
task->art_manual = task->song.art_manual();
|
task->art_manual = task->song.art_manual();
|
||||||
task->art_updated = true;
|
task->art_updated = true;
|
||||||
}
|
}
|
||||||
@ -338,12 +338,12 @@ AlbumCoverLoader::TryLoadResult AlbumCoverLoader::TryLoadImage(Task *task) {
|
|||||||
|
|
||||||
if (!cover_url.isEmpty() && !cover_url.path().isEmpty()) {
|
if (!cover_url.isEmpty() && !cover_url.path().isEmpty()) {
|
||||||
if (cover_url.path() == Song::kManuallyUnsetCover) {
|
if (cover_url.path() == Song::kManuallyUnsetCover) {
|
||||||
return TryLoadResult(false, true, AlbumCoverLoaderResult::Type_ManuallyUnset, QUrl(), task->options.default_output_image_);
|
return TryLoadResult(false, true, AlbumCoverLoaderResult::Type_ManuallyUnset, cover_url, task->options.default_output_image_);
|
||||||
}
|
}
|
||||||
else if (cover_url.path() == Song::kEmbeddedCover && task->song_url.isLocalFile()) {
|
else if (cover_url.path() == Song::kEmbeddedCover && task->song_url.isLocalFile()) {
|
||||||
const QImage taglib_image = TagReaderClient::Instance()->LoadEmbeddedArtBlocking(task->song_url.toLocalFile());
|
const QImage taglib_image = TagReaderClient::Instance()->LoadEmbeddedArtBlocking(task->song_url.toLocalFile());
|
||||||
if (!taglib_image.isNull()) {
|
if (!taglib_image.isNull()) {
|
||||||
return TryLoadResult(false, true, AlbumCoverLoaderResult::Type_Embedded, QUrl(), ScaleAndPad(task->options, taglib_image).first);
|
return TryLoadResult(false, true, AlbumCoverLoaderResult::Type_Embedded, cover_url, ScaleAndPad(task->options, taglib_image).first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cover_url.isLocalFile()) {
|
else if (cover_url.isLocalFile()) {
|
||||||
|
@ -2029,9 +2029,9 @@ void Playlist::UpdateScrobblePoint(const qint64 seek_point_nanosec) {
|
|||||||
void Playlist::AlbumCoverLoaded(const Song &song, const AlbumCoverLoaderResult &result) {
|
void Playlist::AlbumCoverLoaded(const Song &song, const AlbumCoverLoaderResult &result) {
|
||||||
|
|
||||||
// Update art_manual for local songs that are not in the collection.
|
// Update art_manual for local songs that are not in the collection.
|
||||||
if (result.type == AlbumCoverLoaderResult::Type_Manual && result.cover_url.isLocalFile() && (song.source() == Song::Source_LocalFile || song.source() == Song::Source_CDDA || song.source() == Song::Source_Device)) {
|
if (((result.type == AlbumCoverLoaderResult::Type_Manual && result.cover_url.isLocalFile()) || result.type == AlbumCoverLoaderResult::Type_ManuallyUnset) && (song.source() == Song::Source_LocalFile || song.source() == Song::Source_CDDA || song.source() == Song::Source_Device)) {
|
||||||
PlaylistItemPtr item = current_item();
|
PlaylistItemPtr item = current_item();
|
||||||
if (item && item->Metadata() == song && !item->Metadata().art_manual_is_valid()) {
|
if (item && item->Metadata() == song && (!item->Metadata().art_manual_is_valid() || (result.type == AlbumCoverLoaderResult::Type_ManuallyUnset && !item->Metadata().has_manually_unset_cover()))) {
|
||||||
qLog(Debug) << "Updating art manual for local song" << song.title() << song.album() << song.title() << "to" << result.cover_url << "in playlist.";
|
qLog(Debug) << "Updating art manual for local song" << song.title() << song.album() << song.title() << "to" << result.cover_url << "in playlist.";
|
||||||
item->SetArtManual(result.cover_url);
|
item->SetArtManual(result.cover_url);
|
||||||
Save();
|
Save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user