From 354b55cbbcd8205efe0655f6d21d1dad74cbd015 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Thu, 15 Jun 2023 21:06:18 +0200 Subject: [PATCH] Use QFileInfo::path instead of QUrl::RemoveFilename --- src/covermanager/albumcoverchoicecontroller.cpp | 2 +- src/covermanager/albumcovermanager.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/covermanager/albumcoverchoicecontroller.cpp b/src/covermanager/albumcoverchoicecontroller.cpp index cdf137c9a..35b34998d 100644 --- a/src/covermanager/albumcoverchoicecontroller.cpp +++ b/src/covermanager/albumcoverchoicecontroller.cpp @@ -642,7 +642,7 @@ QUrl AlbumCoverChoiceController::SaveCoverToFileAutomatic(const Song *song, cons song->effective_albumartist(), song->effective_album(), song->album_id(), - song->url().adjusted(QUrl::RemoveFilename).path(), + QFileInfo(song->url().toLocalFile()).path(), result, force_overwrite); diff --git a/src/covermanager/albumcovermanager.cpp b/src/covermanager/albumcovermanager.cpp index 8f241c51d..021663bd2 100644 --- a/src/covermanager/albumcovermanager.cpp +++ b/src/covermanager/albumcovermanager.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -965,7 +966,7 @@ void AlbumCoverManager::SaveAndSetCover(AlbumItem *album_item, const AlbumCoverI cover_url = result.cover_url; } else if (!result.image_data.isEmpty() || !result.image.isNull()) { - cover_url = album_cover_choice_controller_->SaveCoverToFileAutomatic(Song::Source::Collection, albumartist, album, QString(), urls.first().adjusted(QUrl::RemoveFilename).path(), result, false); + cover_url = album_cover_choice_controller_->SaveCoverToFileAutomatic(Song::Source::Collection, albumartist, album, QString(), QFileInfo(urls.first().toLocalFile()).path(), result, false); } if (cover_url.isEmpty()) return;