When grouping shares, sort by stime then id (#26777)

If share times are equal, the first share should still win instead of
having the shares swapped.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Vincent Petry 2016-12-06 23:37:57 +01:00 committed by Lukas Reschke
parent 1afdce9ef8
commit 000ba6484f
No known key found for this signature in database
GPG key ID: B9F6980CF6E759B1

View file

@ -123,7 +123,7 @@ class MountProvider implements IMountProvider {
// sort by stime, the super share will be based on the least recent share
foreach ($tmp as &$tmp2) {
@usort($tmp2, function($a, $b) {
if ($a->getShareTime() < $b->getShareTime()) {
if ($a->getShareTime() <= $b->getShareTime()) {
return -1;
}
return 1;