Check whether .cue files exist instead of assuming Qt will return an invalid datetime for non-existent files.
This commit is contained in:
parent
5280038f9a
commit
f95afa4cb3
@ -540,11 +540,16 @@ void LibraryWatcher::PreserveUserSetData(const QString& file, const QString& ima
|
|||||||
|
|
||||||
uint LibraryWatcher::GetMtimeForCue(const QString& cue_path) {
|
uint LibraryWatcher::GetMtimeForCue(const QString& cue_path) {
|
||||||
// slight optimisation
|
// slight optimisation
|
||||||
if(cue_path.isEmpty()) {
|
if (cue_path.isEmpty()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime cue_last_modified = QFileInfo(cue_path).lastModified();
|
const QFileInfo file_info(cue_path);
|
||||||
|
if (!file_info.exists()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDateTime cue_last_modified = file_info.lastModified();
|
||||||
|
|
||||||
return cue_last_modified.isValid()
|
return cue_last_modified.isValid()
|
||||||
? cue_last_modified.toTime_t()
|
? cue_last_modified.toTime_t()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user