[Scummvm-git-logs] scummvm-web master -> fb71c0068df483aa5d2f32ff8163022868a228f3
Thunderforge
noreply at scummvm.org
Sat Nov 27 17:54:23 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:
fb71c0068d WEB: Only sort versions that are old
Commit: fb71c0068df483aa5d2f32ff8163022868a228f3
https://github.com/scummvm/scummvm-web/commit/fb71c0068df483aa5d2f32ff8163022868a228f3
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2021-11-27T11:54:19-06:00
Commit Message:
WEB: Only sort versions that are old
Prevents an issue where release and current builds are getting scrambled
Changed paths:
include/Objects/DownloadsSection.php
diff --git a/include/Objects/DownloadsSection.php b/include/Objects/DownloadsSection.php
index 555afefc..e3a255d5 100644
--- a/include/Objects/DownloadsSection.php
+++ b/include/Objects/DownloadsSection.php
@@ -29,10 +29,12 @@ 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);
- });
+ // If this item is an old version, sort all items by version, descending
+ if ($item->getVersion() !== RELEASE && $item->getVersion() !== 'Daily') {
+ 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