Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit to remove upcoming albums from wanted list #2457

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions headphones/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '"')

Expand All @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion headphones/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down