[Scummvm-git-logs] scummvm-web master -> cc79eb0043941215efb61117ef6edfe58179d0f9
sev-
noreply at scummvm.org
Thu Nov 25 13:53:18 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .
Summary:
cc79eb0043 WEB: Sorting downloads by version after a new one is inserted
Commit: cc79eb0043941215efb61117ef6edfe58179d0f9
https://github.com/scummvm/scummvm-web/commit/cc79eb0043941215efb61117ef6edfe58179d0f9
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2021-11-25T14:53:15+01:00
Commit Message:
WEB: Sorting downloads by version after a new one is inserted
Previously, downloads always got added to the end of the list. Now, the download is added to the end and then the list is sorted by version, meaning that the download will be moved to be the last one of all the downloads with that version.
Changed paths:
include/Objects/DownloadsSection.php
diff --git a/include/Objects/DownloadsSection.php b/include/Objects/DownloadsSection.php
index d4daee55..555afefc 100644
--- a/include/Objects/DownloadsSection.php
+++ b/include/Objects/DownloadsSection.php
@@ -29,6 +29,10 @@ class DownloadsSection extends BasicSection
{
if ($item->getCategoryIcon()) {
$this->items[] = new File($item->toArray(TableMap::TYPE_FIELDNAME), '');
+ // Sort items by version, descending
+ usort($this->items, function ($a, $b) {
+ return -version_compare($a->version, $b->version);
+ });
} else {
$this->items[] = new WebLink($item->toArray(TableMap::TYPE_FIELDNAME));
}
More information about the Scummvm-git-logs
mailing list