summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Ball <michael.ball@gmail.com>2015-02-17 18:59:45 +0000
committerMichaël Ball <michael.ball@gmail.com>2015-02-17 18:59:45 +0000
commiteb962f7008660a6ce5e70927bf4486454519444d (patch)
tree40f97c128dd45878cf0104146cf2573c7a29c16c
parent100c2fadf3c2da01d04be898a07a0846e6fac0f6 (diff)
Better artist handling again
-rw-r--r--models/track.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/models/track.py b/models/track.py
index 896a29a..4d06872 100644
--- a/models/track.py
+++ b/models/track.py
@@ -364,11 +364,15 @@ class Track:
musicbrainz_artistid = ?""",
(musicbrainz_artistid,))
row = rows.fetchone()
+ if not row:
+ rows = c.execute("""SELECT * FROM artist WHERE
+ name = ? AND musicbrainz_artistid IS NULL""",
+ (artist_name,))
+ row = rows.fetchone()
if not row:
rows = c.execute("""SELECT * FROM artist WHERE
- name = ? AND musicbrainz_artistid IS NULL""",
- (artist_name,))
+ name = ?""", (artist_name,))
row = rows.fetchone()
if row:
@@ -376,7 +380,7 @@ class Track:
sortname=row[2],
musicbrainz_artistid=row[3])
- if (musicbrainz_artistid and
+ if (musicbrainz_artistid and
(not hasattr(artist, "musicbrainz_artistid")
or not artist.musicbrainz_artistid)):
c.execute("""UPDATE artist SET