Compare commits

..

1 Commits
19.0 ... 19.1

Author SHA1 Message Date
fc72b23b11 [music] Fix timezones for TSV imports 2025-08-02 23:35:22 -04:00
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,5 @@
from zoneinfo import ZoneInfo
import pendulum
from datetime import datetime
from django.utils import timezone
import logging
from django.conf import settings

View File

@ -2,6 +2,7 @@ import codecs
import csv
import logging
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo
import requests
from django.contrib.auth import get_user_model
@ -61,10 +62,10 @@ def import_audioscrobbler_tsv_file(file_path, user_id):
},
)
continue
timestamp = user.profile.get_timestamp_with_tz(
datetime.fromtimestamp(int(row[AsTsvColumn["TIMESTAMP"].value]))
)
timestamp = datetime.fromtimestamp(
int(row[AsTsvColumn["TIMESTAMP"].value])
).astimezone(ZoneInfo("UTC"))
timestamp = user.profile.get_timestamp_with_tz(timestamp)
stop_timestamp = timestamp + timedelta(seconds=track.run_time_seconds)
new_scrobble = Scrobble(