mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-16 08:35:32 +01:00
Bug fixes: Have bar overflow, List index out of range. Updated findArtist interface
This commit is contained in:
@@ -86,6 +86,10 @@ h1{
|
||||
.smalltext{
|
||||
font-size: 11px;
|
||||
}
|
||||
.mediumtext{
|
||||
font-size: 16px;
|
||||
margin-left: 100px;
|
||||
}
|
||||
.bigtext{
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ class WebInterface(object):
|
||||
havetracks = len(c.fetchall())
|
||||
try:
|
||||
percent = (havetracks*100)/totaltracks
|
||||
if percent > 100:
|
||||
percent = 100
|
||||
except ZeroDivisionError:
|
||||
percent = 100
|
||||
today = datetime.date.today()
|
||||
@@ -117,6 +119,8 @@ class WebInterface(object):
|
||||
havetracks = len(c.fetchall())
|
||||
try:
|
||||
percent = (havetracks*100)/totaltracks
|
||||
if percent > 100:
|
||||
percent = 100
|
||||
except ZeroDivisionError:
|
||||
percent = 100
|
||||
if results[i][3] == 'Skipped':
|
||||
@@ -201,10 +205,10 @@ class WebInterface(object):
|
||||
artistResults = ws.Query().getArtists(ws.ArtistFilter(string.replace(name, '&', '%38'), limit=8))
|
||||
if len(artistResults) == 0:
|
||||
logger.info(u"No results found for " + name)
|
||||
page.append('''No results!<a class="blue" href="home">Go back</a>''')
|
||||
page.append('''<div class="table"><p class="center">No results! <a class="blue" href="home">Go back</a></p></div>''')
|
||||
return page
|
||||
elif len(artistResults) > 1:
|
||||
page.append('''<div class="table">Search returned multiple artists. Click the artist you want to add:<br /><br />''')
|
||||
page.append('''<div class="table"><p class="center">Search returned multiple artists. Click the artist you want to add:</p>''')
|
||||
for result in artistResults:
|
||||
artist = result.artist
|
||||
detail = artist.getDisambiguation()
|
||||
@@ -212,8 +216,8 @@ class WebInterface(object):
|
||||
disambiguation = '(%s)' % detail
|
||||
else:
|
||||
disambiguation = ''
|
||||
page.append('''<a href="addArtist?artistid=%s">%s %s</a> (<a class="externalred" href="artistInfo?artistid=%s">more info</a>)<br />''' % (u.extractUuid(artist.id), artist.name, disambiguation, u.extractUuid(artist.id)))
|
||||
page.append('''</div>''')xs
|
||||
page.append('''<p class="mediumtext"><a href="addArtist?artistid=%s">%s %s</a> (<a class="externalred" href="artistInfo?artistid=%s">more info</a>)</p>''' % (u.extractUuid(artist.id), artist.name, disambiguation, u.extractUuid(artist.id)))
|
||||
page.append('''</div>''')
|
||||
return page
|
||||
else:
|
||||
for result in artistResults:
|
||||
|
||||
Reference in New Issue
Block a user