diff --git a/webServer.py b/webServer.py index fa4b5c7a..db4bbd55 100644 --- a/webServer.py +++ b/webServer.py @@ -119,7 +119,6 @@ class Headphones: page = [templates._header] page.append(templates._logobar) page.append(templates._nav) - conn=sqlite3.connect(database) c=conn.cursor() c.execute('''SELECT ArtistID, ArtistName, AlbumTitle, TrackTitle, TrackDuration, TrackID, AlbumASIN from tracks WHERE AlbumID="%s"''' % AlbumID) @@ -312,7 +311,35 @@ class Headphones: page = [templates._header] page.append(templates._logobar) page.append(templates._nav) - #page.append(templates._footer) + today = datetime.date.today() + todaysql = datetime.date.isoformat(today) + conn=sqlite3.connect(database) + c=conn.cursor() + c.execute('''SELECT AlbumTitle, ReleaseDate, DateAdded, AlbumASIN, AlbumID, ArtistName, ArtistID from albums WHERE ReleaseDate > date('now') order by ReleaseDate DESC''') + albums = c.fetchall() + if len(albums) > 0: + page.append('''
+ + + + + + ''') + i = 0 + while i < len(albums): + + if albums[i][3]: + albumart = '''


''' % (albums[i][3], albums[i][3]) + else: + albumart = 'No Album Art... yet.' + + page.append(''' + + + ''' % (albumart, albums[i][6], albums[i][5], albums[i][4], albums[i][0], albums[i][1])) + i += 1 + page.append('''
Upcoming Albums

%s%s%s (%s)
''') + page.append(templates._footer) return page upcoming.exposed = True