CoverUtils: Only create path if it doesn't exist

This commit is contained in:
Jonas Kvinge 2023-06-15 21:04:11 +02:00
parent 950c236720
commit b87a950357
1 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include <QString>
#include <QRegularExpression>
#include <QUrl>
#include <QFileInfo>
#include <QDir>
#include <QStandardPaths>
#include <QCryptographicHash>
@ -80,7 +81,7 @@ QString CoverUtils::CoverFilePath(const CoverOptions &options, const Song::Sourc
}
QDir dir;
if (!dir.mkpath(path)) {
if (!QFileInfo::exists(path) && !dir.mkpath(path)) {
qLog(Error) << "Unable to create directory" << path;
path = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
}