mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-24 20:37:45 +01:00
Bug Fixes: 503 Error on import, fixed sorting
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user