mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-21 19:07:44 +01:00
Fixed issue where new releases weren't being added to the database
This commit is contained in:
+7
-3
@@ -16,8 +16,12 @@ def dbUpdate():
|
||||
i = 0
|
||||
|
||||
while i < len(activeartists):
|
||||
|
||||
|
||||
artistid = activeartists[i][0]
|
||||
|
||||
c.execute('SELECT AlbumID from albums WHERE ArtistID="%s"' % artistid)
|
||||
albumlist = c.fetchall()
|
||||
|
||||
inc = ws.ArtistIncludes(releases=(m.Release.TYPE_OFFICIAL, m.Release.TYPE_ALBUM), ratings=False, releaseGroups=False)
|
||||
artist = ws.Query().getArtistById(artistid, inc)
|
||||
|
||||
@@ -32,7 +36,7 @@ def dbUpdate():
|
||||
|
||||
if event.country == 'US':
|
||||
|
||||
if (u.extractUuid(results.id) in x for x in activeartists):
|
||||
if any(releaseid in x for x in albumlist):
|
||||
|
||||
c.execute('UPDATE albums SET AlbumASIN="%s", ReleaseDate="%s" WHERE AlbumID="%s"' % (results.asin, results.getEarliestReleaseDate(), u.extractUuid(results.id)))
|
||||
|
||||
@@ -61,7 +65,7 @@ def dbUpdate():
|
||||
conn.commit()
|
||||
|
||||
else:
|
||||
print '''%s is not a US release''' % results.title
|
||||
pass
|
||||
i += 1
|
||||
|
||||
conn.commit()
|
||||
|
||||
Reference in New Issue
Block a user