Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 59d0108fe5 | |||
| 8d67b672f9 | |||
| 376650f937 | |||
| 485fbd63a3 |
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "vrobbler"
|
||||
version = "0.9.0"
|
||||
version = "0.9.2"
|
||||
description = ""
|
||||
authors = ["Colin Powell <colin@unbl.ink>"]
|
||||
|
||||
|
||||
@ -56,6 +56,7 @@ class AudioScrobblerTSVImport(TimeStampedModel):
|
||||
scrobbles = process_audioscrobbler_tsv_file(
|
||||
self.tsv_file.path, user_tz=tz
|
||||
)
|
||||
self.process_log = ""
|
||||
if scrobbles:
|
||||
for count, scrobble in enumerate(scrobbles):
|
||||
scrobble_str = f"{scrobble.id}\t{scrobble.timestamp}\t{scrobble.track.title}"
|
||||
|
||||
@ -37,7 +37,7 @@ def process_audioscrobbler_tsv_file(file_path, user_tz=None):
|
||||
)
|
||||
continue
|
||||
artist = get_or_create_artist(row[0])
|
||||
album = get_or_create_album(row[1])
|
||||
album = get_or_create_album(row[1], artist)
|
||||
|
||||
track = get_or_create_track(
|
||||
title=row[2],
|
||||
@ -45,15 +45,14 @@ def process_audioscrobbler_tsv_file(file_path, user_tz=None):
|
||||
artist=artist,
|
||||
album=album,
|
||||
run_time=row[4],
|
||||
run_time_ticks=row[4] * 1000,
|
||||
run_time_ticks=int(row[4]) * 1000,
|
||||
)
|
||||
|
||||
timestamp = (
|
||||
datetime.utcfromtimestamp(int(row[6]))
|
||||
datetime.fromtimestamp(int(row[6]))
|
||||
.replace(tzinfo=user_tz)
|
||||
.astimezone(pytz.utc)
|
||||
)
|
||||
source = 'Audioscrobbler File'
|
||||
|
||||
new_scrobble = Scrobble(
|
||||
timestamp=timestamp,
|
||||
|
||||
Reference in New Issue
Block a user