CoverUtils: Only create path if it doesn't exist
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
@@ -80,7 +81,7 @@ QString CoverUtils::CoverFilePath(const CoverOptions &options, const Song::Sourc
|
|||||||
}
|
}
|
||||||
|
|
||||||
QDir dir;
|
QDir dir;
|
||||||
if (!dir.mkpath(path)) {
|
if (!QFileInfo::exists(path) && !dir.mkpath(path)) {
|
||||||
qLog(Error) << "Unable to create directory" << path;
|
qLog(Error) << "Unable to create directory" << path;
|
||||||
path = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
|
path = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user