[music] Fix how we create tracks from LastFM

This commit is contained in:
2024-11-05 14:47:30 -05:00
parent 2c1e8c08ae
commit 622a30899f

View File

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