From 12e19d54164adcd33b7597427368a460f5dfa892 Mon Sep 17 00:00:00 2001
From: junior <junior@jaj.com>
Date: Tue, 15 Feb 2022 21:13:29 +0000
Subject: [PATCH] Tweak image display order

---
 class_image.php   | 4 ++--
 js/scalemodels.js | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/class_image.php b/class_image.php
index d931976..5e83ee2 100644
--- a/class_image.php
+++ b/class_image.php
@@ -186,7 +186,7 @@ class Image implements JsonSerializable {
     public static function getImagesForAlbum($albumid = 0) {
         global $globaldbh;
 
-        $query = "SELECT id FROM " . AppDB::TABLE_IMAGES . " WHERE album_id=:album_id ORDER BY title";
+        $query = "SELECT id FROM " . AppDB::TABLE_IMAGES . " WHERE album_id=:album_id ORDER BY filename";
         $sth = $globaldbh->prepare($query);
         $sth->bindValue(":album_id", (int) $albumid, PDO::PARAM_INT);
         $sth->execute();
@@ -238,7 +238,7 @@ class Image implements JsonSerializable {
     public static function getList() {
         global $globaldbh;
 
-        $query = "SELECT id FROM " . AppDB::TABLE_IMAGES . " ORDER BY album_id, title";
+        $query = "SELECT id FROM " . AppDB::TABLE_IMAGES . " ORDER BY album_id, filename";
         $sth = $globaldbh->prepare($query);
         $sth->execute();
         $thelist = array();
diff --git a/js/scalemodels.js b/js/scalemodels.js
index ebfe521..bbe3a6a 100644
--- a/js/scalemodels.js
+++ b/js/scalemodels.js
@@ -60,6 +60,7 @@ function refreshAlbums() {
         dataType: 'json',
         success: function(data, stat, jqo) {
             toastr.success("Album list refreshed", "Refresh");
+            getAlbumInfo();
         },
         error: function(jqp, status, error) {
             toastr.error("Error refreshing album list!\n" + error, "Server Error");