mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-15 13:34:00 +01:00
Merge branch 'develop': Bug fixes. Don't mark albums with no releases as wanted.
Sort albums with no release dates correctly in UI
This commit is contained in:
@@ -210,7 +210,7 @@
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
{ "sType": "date" },
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
{ "sType": "title-numeric"},
|
{ "sType": "title-numeric"},
|
||||||
|
|||||||
+2
-2
@@ -326,8 +326,8 @@ def getRelease(releaseid, include_artist_info=True):
|
|||||||
|
|
||||||
release['title'] = unicode(results['title'])
|
release['title'] = unicode(results['title'])
|
||||||
release['id'] = unicode(results['id'])
|
release['id'] = unicode(results['id'])
|
||||||
release['asin'] = unicode(results['asin']) if 'asin' in results else u'None'
|
release['asin'] = unicode(results['asin']) if 'asin' in results else None
|
||||||
release['date'] = unicode(results['date']) if 'date' in results else u'None'
|
release['date'] = unicode(results['date']) if 'date' in results else None
|
||||||
try:
|
try:
|
||||||
release['format'] = unicode(results['medium-list'][0]['format'])
|
release['format'] = unicode(results['medium-list'][0]['format'])
|
||||||
except:
|
except:
|
||||||
|
|||||||
+15
-2
@@ -62,6 +62,21 @@ class WebInterface(object):
|
|||||||
artist = myDB.action('SELECT * FROM artists WHERE ArtistID=?', [ArtistID]).fetchone()
|
artist = myDB.action('SELECT * FROM artists WHERE ArtistID=?', [ArtistID]).fetchone()
|
||||||
albums = myDB.select('SELECT * from albums WHERE ArtistID=? order by ReleaseDate DESC', [ArtistID])
|
albums = myDB.select('SELECT * from albums WHERE ArtistID=? order by ReleaseDate DESC', [ArtistID])
|
||||||
|
|
||||||
|
# Don't redirect to the artist page until it has the bare minimum info inserted
|
||||||
|
# Redirect to the home page if we still can't get it after 5 seconds
|
||||||
|
retry = 0
|
||||||
|
|
||||||
|
while retry < 5:
|
||||||
|
if not artist:
|
||||||
|
time.sleep(1)
|
||||||
|
artist = myDB.action('SELECT * FROM artists WHERE ArtistID=?', [ArtistID]).fetchone()
|
||||||
|
retry += 1
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
|
if not artist:
|
||||||
|
raise cherrypy.HTTPRedirect("home")
|
||||||
|
|
||||||
# Serve the extras up as a dict to make things easier for new templates
|
# Serve the extras up as a dict to make things easier for new templates
|
||||||
extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook"]
|
extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook"]
|
||||||
extras_dict = {}
|
extras_dict = {}
|
||||||
@@ -79,8 +94,6 @@ class WebInterface(object):
|
|||||||
extras_dict[extra] = ""
|
extras_dict[extra] = ""
|
||||||
i+=1
|
i+=1
|
||||||
|
|
||||||
if artist is None:
|
|
||||||
raise cherrypy.HTTPRedirect("home")
|
|
||||||
return serve_template(templatename="artist.html", title=artist['ArtistName'], artist=artist, albums=albums, extras=extras_dict)
|
return serve_template(templatename="artist.html", title=artist['ArtistName'], artist=artist, albums=albums, extras=extras_dict)
|
||||||
artistPage.exposed = True
|
artistPage.exposed = True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user