瀏覽代碼

Rather change names than fuck up MB IDs

Colin Powell 2 年之前
父節點
當前提交
bb69be4817
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      vrobbler/apps/music/utils.py

+ 3 - 3
vrobbler/apps/music/utils.py

@@ -56,15 +56,15 @@ def get_or_create_album(
 
     if not album and name:
         mbid = mbid or album_dict["mb_id"]
-        album, album_created = Album.objects.get_or_create(
-            name=name, musicbrainz_id=mbid
-        )
+        album, album_created = Album.objects.get_or_create(musicbrainz_id=mbid)
         if album_created:
+            album.name = name
             album.year = album_dict["year"]
             album.musicbrainz_releasegroup_id = album_dict["mb_group_id"]
             album.musicbrainz_albumartist_id = artist.musicbrainz_id
             album.save(
                 update_fields=[
+                    "name",
                     "musicbrainz_id",
                     "year",
                     "musicbrainz_releasegroup_id",