Videos: DESC sorting instead of ASC

This commit is contained in:
veselcraft 2021-11-20 12:56:59 +03:00
parent af45a85ff7
commit b1a4a4a895
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E

View file

@ -37,7 +37,7 @@ class Videos
function getByUser(User $user, int $page = 1, ?int $perPage = NULL): \Traversable
{
$perPage = $perPage ?? OPENVK_DEFAULT_PER_PAGE;
foreach($this->videos->where("owner", $user->getId())->where(["deleted" => 0, "unlisted" => 0])->page($page, $perPage) as $video)
foreach($this->videos->where("owner", $user->getId())->where(["deleted" => 0, "unlisted" => 0])->page($page, $perPage)->order("created DESC") as $video)
yield new Video($video);
}