Bug Fixes: 503 Error on import, fixed sorting

This commit is contained in:
Remy
2011-07-14 15:44:02 -07:00
parent bac8689276
commit f21ff06227
2 changed files with 11 additions and 2 deletions
+6 -1
View File
@@ -99,11 +99,16 @@ def importartist(artistlist):
if any(artistid in x for x in artistlist):
logger.info(result.artist.name + u" is already in the database, skipping")
else:
c.execute('INSERT INTO artists VALUES( ?, ?, ?, CURRENT_DATE, ?)', (artistid, artist.name, artist.sortName, 'Active'))
if artist.name.startswith('The '):
sortname = artist.name[4:]
else:
sortname = artist.name
c.execute('INSERT INTO artists VALUES( ?, ?, ?, CURRENT_DATE, ?)', (artistid, artist.name, sortname, 'Active'))
for rg in artist.getReleaseGroups():
rgid = u.extractUuid(rg.id)
releaseid = getReleaseGroup(rgid)
time.sleep(1)
inc = ws.ReleaseIncludes(artist=True, releaseEvents= True, tracks= True, releaseGroup=True)
results = ws.Query().getReleaseById(releaseid, inc)
+5 -1
View File
@@ -259,7 +259,11 @@ class WebInterface(object):
else:
logger.info(u"Adding " + artist.name + " to the database.")
c.execute('INSERT INTO artists VALUES( ?, ?, ?, CURRENT_DATE, ?)', (artistid, artist.name, artist.sortName, 'Active'))
if artist.name.startswith('The '):
sortname = artist.name[4:]
else:
sortname = artist.name
c.execute('INSERT INTO artists VALUES( ?, ?, ?, CURRENT_DATE, ?)', (artistid, artist.name, sortname, 'Active'))
for rg in artist.getReleaseGroups():
rgid = u.extractUuid(rg.id)