luci-app-opkg: populate alternative package size if needed
authorJo-Philipp Wich <jo@mein.io>
Mon, 27 May 2024 12:09:53 +0000 (14:09 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 27 May 2024 12:10:50 +0000 (14:10 +0200)
Populate the raw size value with the alternative size if the package
size is unavailable.

Fixes: #7139
Fixes: 63e5d38db0 ("luci-app-opkg: fix sorting by size column")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js

index 246c5cfce81a8e7a6c5d030f170c264aba731a50..bb21cca687802dac72d115cd46f274bd422c358c 100644 (file)
@@ -310,9 +310,9 @@ function display(pattern)
                currentDisplayRows.push([
                        name,
                        ver,
-                       [ pkg.size || 0,
-                          pkg.size ? '%1024mB'.format(pkg.size)
-                                : (altsize ? '~%1024mB'.format(altsize) : '-') ],
+                       [ pkg.size || altsize || 0,
+                         pkg.size ? '%1024mB'.format(pkg.size)
+                                  : (altsize ? '~%1024mB'.format(altsize) : '-') ],
                        desc,
                        btn
                ]);