From 6be8e068a916ee449f64901bf54df66f10b63968 Mon Sep 17 00:00:00 2001 From: Remy Date: Tue, 14 Jun 2011 06:29:17 -0700 Subject: [PATCH] Fixed issue where new releases weren't being added to the database --- updater.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/updater.py b/updater.py index 17510fce..85fd5243 100644 --- a/updater.py +++ b/updater.py @@ -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()