From 622a30899f85143058e76a23381569c1be409e8d Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 5 Nov 2024 14:47:30 -0500 Subject: [PATCH] [music] Fix how we create tracks from LastFM --- vrobbler/apps/music/lastfm.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vrobbler/apps/music/lastfm.py b/vrobbler/apps/music/lastfm.py index c8a0698..0f8f8f0 100644 --- a/vrobbler/apps/music/lastfm.py +++ b/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: