소스 검색

[music] Fix how we create tracks from LastFM

Colin Powell 8 달 전
부모
커밋
622a30899f
1개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. 9 9
      vrobbler/apps/music/lastfm.py

+ 9 - 9
vrobbler/apps/music/lastfm.py

@@ -49,15 +49,15 @@ class LastFM:
         lastfm_scrobbles = self.get_last_scrobbles(time_from=last_processed)
 
         for lfm_scrobble in lastfm_scrobbles:
-            timestamp = lfm_scrobble.pop("timestamp")
-
-            artist = get_or_create_artist(lfm_scrobble.pop("artist"))
-            album = get_or_create_album(lfm_scrobble.pop("album"), artist)
-
-            lfm_scrobble["artist"] = artist
-            if album:
-                lfm_scrobble["album"] = album
-            track = get_or_create_track(**lfm_scrobble)
+            track = get_or_create_track(
+                lfm_scrobble,
+                {
+                    "TRACK_TITLE": "track",
+                    "ARTIST_NAME": "artist",
+                    "ALBUM_NAME": "album",
+                    "TIMESTAMP": "timestamp",
+                },
+            )
 
             timezone = settings.TIME_ZONE
             if self.vrobbler_user.profile: