Fix multiple entries in external share
parent
9c77a8f0c8
commit
77b1101bb3
|
@ -51,6 +51,11 @@ trait TimelineQueryDay {
|
|||
// Add favorite field
|
||||
$this->addFavoriteTag($query, $user);
|
||||
|
||||
// Get distinct fileids only
|
||||
// This is required when browsing a folder in external storage
|
||||
// since the same file can be present for multiple users
|
||||
$query->groupBy('m.fileid');
|
||||
|
||||
// Group and sort by date taken
|
||||
$query->orderBy('m.datetaken', 'DESC');
|
||||
return $query;
|
||||
|
|
|
@ -29,7 +29,8 @@ trait TimelineQueryDays {
|
|||
$whereFilecache
|
||||
) {
|
||||
// Get all entries also present in filecache
|
||||
$query->select('m.dayid', $query->func()->count('m.fileid', 'count'))
|
||||
$count = $query->func()->count($query->createFunction('DISTINCT m.fileid'), 'count');
|
||||
$query->select('m.dayid', $count)
|
||||
->from('memories', 'm')
|
||||
->innerJoin('m', 'filecache', 'f',
|
||||
$query->expr()->andX(
|
||||
|
|
Loading…
Reference in New Issue