From 44efbaf7326d3c86fa7b1828e7c7d51894e3158f Mon Sep 17 00:00:00 2001 From: kooimens Date: Tue, 22 Dec 2015 23:11:52 +0100 Subject: [PATCH 1/4] Add sort on releasedate to wanted --- headphones/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headphones/api.py b/headphones/api.py index a8b97c02b..4546ea097 100644 --- a/headphones/api.py +++ b/headphones/api.py @@ -162,12 +162,12 @@ def _getHistory(self, **kwargs): def _getUpcoming(self, **kwargs): self.data = self._dic_from_query( - "SELECT * from albums WHERE ReleaseDate > date('now') order by ReleaseDate DESC") + "SELECT * from albums WHERE ReleaseDate > date('now') order by ReleaseDate ASC") return def _getWanted(self, **kwargs): self.data = self._dic_from_query( - "SELECT * from albums WHERE Status='Wanted'") + "SELECT * from albums WHERE Status='Wanted' and ReleaseDate <= date ('now') order by ReleaseDate DESC") return def _getSnatched(self, **kwargs): From 97a499cb3667890aa8174b7cc80185dd2d2a300f Mon Sep 17 00:00:00 2001 From: kooimens Date: Tue, 22 Dec 2015 23:24:11 +0100 Subject: [PATCH 2/4] Remove upcoming albums from wanted list & Sort wanted albums on latest firs --- headphones/webserve.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headphones/webserve.py b/headphones/webserve.py index 561dea0e3..d9597fafc 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -531,7 +531,8 @@ def upcoming(self): 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' and ReleaseDate <= date ('now') order by ReleaseDate DESC) return serve_template(templatename="upcoming.html", title="Upcoming", upcoming=upcoming, wanted=wanted) From e74d2e9c96cae804cfe720deca30a05c8d3e50a4 Mon Sep 17 00:00:00 2001 From: kooimens Date: Tue, 22 Dec 2015 23:49:26 +0100 Subject: [PATCH 3/4] Fix issue --- headphones/webserve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/webserve.py b/headphones/webserve.py index d9597fafc..ea740c3f4 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -532,7 +532,7 @@ def upcoming(self): upcoming = myDB.select( "SELECT * from albums WHERE ReleaseDate > date('now') order by ReleaseDate ASC") wanted = myDB.select( - "SELECT * from albums WHERE Status='Wanted' and ReleaseDate <= date ('now') order by ReleaseDate DESC) + "SELECT * from albums WHERE Status='Wanted' and ReleaseDate <= date ('now') order by ReleaseDate DESC") return serve_template(templatename="upcoming.html", title="Upcoming", upcoming=upcoming, wanted=wanted) From c4f9ead2e8c2dcdec80acbbd5db80a871ee9a5fd Mon Sep 17 00:00:00 2001 From: kooimens Date: Wed, 23 Dec 2015 13:04:18 +0100 Subject: [PATCH 4/4] Return album tracks ascending --- headphones/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/api.py b/headphones/api.py index 4546ea097..e38dce6e8 100644 --- a/headphones/api.py +++ b/headphones/api.py @@ -147,7 +147,7 @@ def _getAlbum(self, **kwargs): album = self._dic_from_query( 'SELECT * from albums WHERE AlbumID="' + self.id + '"') tracks = self._dic_from_query( - 'SELECT * from tracks WHERE AlbumID="' + self.id + '"') + 'SELECT * from tracks WHERE AlbumID="' + self.id + '" order by TrackNumber ASC') description = self._dic_from_query( 'SELECT * from descriptions WHERE ReleaseGroupID="' + self.id + '"')