diff --git a/ext/libstrawberry-tagreader/tagreadermessages.proto b/ext/libstrawberry-tagreader/tagreadermessages.proto index b16d0b924..d6d7e8d9d 100644 --- a/ext/libstrawberry-tagreader/tagreadermessages.proto +++ b/ext/libstrawberry-tagreader/tagreadermessages.proto @@ -55,8 +55,8 @@ message SongMetadata { optional string basefilename = 22; optional FileType filetype = 23; optional int32 filesize = 24; - optional int32 mtime = 25; - optional int32 ctime = 26; + optional int64 mtime = 25; + optional int64 ctime = 26; optional int32 playcount = 27; optional int32 skipcount = 28; diff --git a/src/collection/collectionbackend.cpp b/src/collection/collectionbackend.cpp index e39798381..9b5c2a92f 100644 --- a/src/collection/collectionbackend.cpp +++ b/src/collection/collectionbackend.cpp @@ -222,7 +222,7 @@ SubdirectoryList CollectionBackend::SubdirsInDirectory(int id, QSqlDatabase &db) Subdirectory subdir; subdir.directory_id = id; subdir.path = q.value(0).toString(); - subdir.mtime = q.value(1).toUInt(); + subdir.mtime = q.value(1).toLongLong(); subdirs << subdir; } diff --git a/src/collection/collectionwatcher.cpp b/src/collection/collectionwatcher.cpp index 4bee75382..97f982731 100644 --- a/src/collection/collectionwatcher.cpp +++ b/src/collection/collectionwatcher.cpp @@ -393,7 +393,7 @@ void CollectionWatcher::ScanSubdirectory(const QString &path, const Subdirectory Song matching_song(source_); if (FindSongByPath(songs_in_db, file, &matching_song)) { - quint64 matching_cue_mtime = GetMtimeForCue(matching_cue); + qint64 matching_cue_mtime = GetMtimeForCue(matching_cue); // The song is in the database and still on disk. // Check the mtime to see if it's been changed since it was added. @@ -413,7 +413,7 @@ void CollectionWatcher::ScanSubdirectory(const QString &path, const Subdirectory bool cue_added = matching_cue_mtime != 0 && !matching_song.has_cue(); // watch out for cue songs which have their mtime equal to qMax(media_file_mtime, cue_sheet_mtime) - bool changed = (matching_song.mtime() != static_cast(qMax(file_info.lastModified().toSecsSinceEpoch(), song_cue_mtime))) || cue_deleted || cue_added; + bool changed = (matching_song.mtime() != qMax(file_info.lastModified().toSecsSinceEpoch(), song_cue_mtime)) || cue_deleted || cue_added; // Also want to look to see whether the album art has changed QUrl image = ImageForSong(file, album_art); diff --git a/src/collection/directory.h b/src/collection/directory.h index 665c950fa..6b14b8e9e 100644 --- a/src/collection/directory.h +++ b/src/collection/directory.h @@ -49,7 +49,7 @@ struct Subdirectory { int directory_id; QString path; - uint mtime; + qint64 mtime; }; Q_DECLARE_METATYPE(Subdirectory) diff --git a/src/core/song.cpp b/src/core/song.cpp index 143612b39..42696c588 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -199,8 +199,8 @@ struct Song::Private : public QSharedData { QUrl url_; FileType filetype_; int filesize_; - int mtime_; - int ctime_; + qint64 mtime_; + qint64 ctime_; bool unavailable_; int playcount_; @@ -322,8 +322,8 @@ const QUrl &Song::url() const { return d->url_; } const QString &Song::basefilename() const { return d->basefilename_; } Song::FileType Song::filetype() const { return d->filetype_; } int Song::filesize() const { return d->filesize_; } -quint64 Song::mtime() const { return d->mtime_; } -quint64 Song::ctime() const { return d->ctime_; } +qint64 Song::mtime() const { return d->mtime_; } +qint64 Song::ctime() const { return d->ctime_; } int Song::playcount() const { return d->playcount_; } int Song::skipcount() const { return d->skipcount_; } @@ -428,8 +428,8 @@ void Song::set_url(const QUrl &v) { d->url_ = v; } void Song::set_basefilename(const QString &v) { d->basefilename_ = v; } void Song::set_filetype(FileType v) { d->filetype_ = v; } void Song::set_filesize(int v) { d->filesize_ = v; } -void Song::set_mtime(int v) { d->mtime_ = v; } -void Song::set_ctime(int v) { d->ctime_ = v; } +void Song::set_mtime(qint64 v) { d->mtime_ = v; } +void Song::set_ctime(qint64 v) { d->ctime_ = v; } void Song::set_unavailable(bool v) { d->unavailable_ = v; } void Song::set_playcount(int v) { d->playcount_ = v; } @@ -925,10 +925,10 @@ void Song::InitFromQuery(const SqlRow &q, bool reliable_metadata, int col) { d->filesize_ = toint(x); } else if (Song::kColumns.value(i) == "mtime") { - d->mtime_ = toint(x); + d->mtime_ = tolonglong(x); } else if (Song::kColumns.value(i) == "ctime") { - d->ctime_ = toint(x); + d->ctime_ = tolonglong(x); } else if (Song::kColumns.value(i) == "unavailable") { d->unavailable_ = q.value(x).toBool(); diff --git a/src/core/song.h b/src/core/song.h index 208e010c1..a5cbd3de3 100644 --- a/src/core/song.h +++ b/src/core/song.h @@ -227,8 +227,8 @@ class Song { const QString &basefilename() const; FileType filetype() const; int filesize() const; - quint64 mtime() const; - quint64 ctime() const; + qint64 mtime() const; + qint64 ctime() const; int playcount() const; int skipcount() const; @@ -328,8 +328,8 @@ class Song { void set_basefilename(const QString &v); void set_filetype(FileType v); void set_filesize(int v); - void set_mtime(int v); - void set_ctime(int v); + void set_mtime(qint64 v); + void set_ctime(qint64 v); void set_unavailable(bool v); void set_playcount(int v); diff --git a/src/playlistparsers/cueparser.cpp b/src/playlistparsers/cueparser.cpp index 373702c5b..3fb8ca1c5 100644 --- a/src/playlistparsers/cueparser.cpp +++ b/src/playlistparsers/cueparser.cpp @@ -237,7 +237,7 @@ SongList CueParser::Load(QIODevice *device, const QString &playlist_path, const // Cue song has mtime equal to qMax(media_file_mtime, cue_sheet_mtime) if (cue_mtime.isValid()) { - song.set_mtime(qMax(static_cast(cue_mtime.toSecsSinceEpoch()), song.mtime())); + song.set_mtime(qMax(cue_mtime.toSecsSinceEpoch(), song.mtime())); } song.set_cue_path(playlist_path);