Use the last modified file attribute in order to display recently added items. fixes #51

This commit is contained in:
emeric
2020-05-02 14:34:40 +02:00
parent 6c1a7863eb
commit 9edad1314e
10 changed files with 19 additions and 19 deletions
+3 -3
View File
@@ -147,13 +147,13 @@ Track::getMBIDDuplicates(Session& session)
}
std::vector<Track::pointer>
Track::getLastAdded(Session& session, const Wt::WDateTime& after, std::optional<std::size_t> limit)
Track::getLastWritten(Session& session, const Wt::WDateTime& after, std::optional<std::size_t> limit)
{
session.checkSharedLocked();
Wt::Dbo::collection<Track::pointer> res = session.getDboSession().find<Track>()
.where("file_added > ?").bind(after)
.orderBy("file_added DESC")
.where("file_last_write > ?").bind(after)
.orderBy("file_last_write DESC")
.limit(limit ? static_cast<int>(*limit) : -1);
return std::vector<pointer>(res.begin(), res.end());