From 80fe81e3459d8c0400138df1c2ac0985be5c729c Mon Sep 17 00:00:00 2001 From: David Logie Date: Thu, 16 Mar 2017 20:27:39 +0000 Subject: [PATCH] Sorted wanted albums by release date. Without this SQLite will order the results by whichever column happens to be the fastest for it. This will usually result in the rows being sorted by the primary key (or rowid). Sorting by release date also matches the sort order of the "upcoming" albums list. --- headphones/webserve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/webserve.py b/headphones/webserve.py index ee353fe2..bef5c315 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -537,7 +537,7 @@ class WebInterface(object): myDB = db.DBConnection() upcoming = myDB.select( "SELECT * from albums WHERE ReleaseDate > date('now') order by ReleaseDate ASC") - wanted = myDB.select("SELECT * from albums WHERE Status='Wanted'") + wanted = myDB.select("SELECT * from albums WHERE Status='Wanted' order by ReleaseDate ASC") return serve_template(templatename="upcoming.html", title="Upcoming", upcoming=upcoming, wanted=wanted)