db/Interface: GetUpdateStamp() returns std::chrono::system_clock::time_point
This commit is contained in:
@@ -157,7 +157,7 @@ SimpleDatabase::Load()
|
||||
|
||||
FileInfo fi;
|
||||
if (GetFileInfo(path, fi))
|
||||
mtime = std::chrono::system_clock::to_time_t(fi.GetModificationTime());
|
||||
mtime = fi.GetModificationTime();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -166,7 +166,7 @@ SimpleDatabase::Open()
|
||||
assert(prefixed_light_song == nullptr);
|
||||
|
||||
root = Directory::NewRoot();
|
||||
mtime = 0;
|
||||
mtime = std::chrono::system_clock::time_point::min();
|
||||
|
||||
#ifndef NDEBUG
|
||||
borrowed_song_count = 0;
|
||||
@@ -358,7 +358,7 @@ SimpleDatabase::Save()
|
||||
|
||||
FileInfo fi;
|
||||
if (GetFileInfo(path, fi))
|
||||
mtime = std::chrono::system_clock::to_time_t(fi.GetModificationTime());
|
||||
mtime = fi.GetModificationTime();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -50,7 +50,7 @@ class SimpleDatabase : public Database {
|
||||
|
||||
Directory *root;
|
||||
|
||||
time_t mtime;
|
||||
std::chrono::system_clock::time_point mtime;
|
||||
|
||||
/**
|
||||
* A buffer for GetSong() when prefixing the #LightSong
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
* Returns true if there is a valid database file on the disk.
|
||||
*/
|
||||
bool FileExists() const {
|
||||
return mtime > 0;
|
||||
return mtime >= std::chrono::system_clock::time_point(std::chrono::system_clock::duration::zero());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
|
||||
DatabaseStats GetStats(const DatabaseSelection &selection) const override;
|
||||
|
||||
time_t GetUpdateStamp() const override {
|
||||
std::chrono::system_clock::time_point GetUpdateStamp() const override {
|
||||
return mtime;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user