Add "added" timestamp to song database
- added is set to current time, if a new song is added to the database. - GetAdded falls back to mtime. Code for proxy plugin is missing, this needs a patch for libmpdclient. closes #378
This commit is contained in:
@@ -127,6 +127,17 @@ PrintSortedQueue(Response &r, const Queue &queue,
|
||||
|
||||
return a.GetLastModified() < b.GetLastModified();
|
||||
});
|
||||
else if (sort == TagType(SORT_TAG_ADDED))
|
||||
std::stable_sort(v.begin(), v.end(),
|
||||
[&queue, descending](unsigned a_pos, unsigned b_pos){
|
||||
if (descending)
|
||||
std::swap(a_pos, b_pos);
|
||||
|
||||
const auto &a = queue.Get(a_pos);
|
||||
const auto &b = queue.Get(b_pos);
|
||||
|
||||
return a.GetAdded() < b.GetAdded();
|
||||
});
|
||||
else if (sort == TagType(SORT_TAG_PRIO))
|
||||
std::stable_sort(v.begin(), v.end(),
|
||||
[&queue, descending](unsigned a_pos, unsigned b_pos){
|
||||
|
Reference in New Issue
Block a user