Change mtime and ctime to qint64
This commit is contained in:
parent
7aebd6ed57
commit
c315e5016d
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<quint64>(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);
|
||||
|
|
|
@ -49,7 +49,7 @@ struct Subdirectory {
|
|||
|
||||
int directory_id;
|
||||
QString path;
|
||||
uint mtime;
|
||||
qint64 mtime;
|
||||
};
|
||||
Q_DECLARE_METATYPE(Subdirectory)
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<quint64>(cue_mtime.toSecsSinceEpoch()), song.mtime()));
|
||||
song.set_mtime(qMax(cue_mtime.toSecsSinceEpoch(), song.mtime()));
|
||||
}
|
||||
song.set_cue_path(playlist_path);
|
||||
|
||||
|
|
Loading…
Reference in New Issue