diff options
author | Michaël Ball <michael.ball@gmail.com> | 2015-02-17 18:59:45 +0000 |
---|---|---|
committer | Michaël Ball <michael.ball@gmail.com> | 2015-02-17 18:59:45 +0000 |
commit | eb962f7008660a6ce5e70927bf4486454519444d (patch) | |
tree | 40f97c128dd45878cf0104146cf2573c7a29c16c | |
parent | 100c2fadf3c2da01d04be898a07a0846e6fac0f6 (diff) |
Better artist handling again
-rw-r--r-- | models/track.py | 10 |
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 |