Explorar o código

I don't think TSV files are in UTC after all

Colin Powell %!s(int64=2) %!d(string=hai) anos
pai
achega
bcf2b9d1ea
Modificáronse 1 ficheiros con 3 adicións e 5 borrados
  1. 3 5
      vrobbler/apps/scrobbles/tsv.py

+ 3 - 5
vrobbler/apps/scrobbles/tsv.py

@@ -65,11 +65,9 @@ def process_audioscrobbler_tsv_file(file_path, user_id, user_tz=None):
             )
             continue
 
-        timestamp = (
-            datetime.utcfromtimestamp(int(row[AsTsvColumn["TIMESTAMP"].value]))
-            .replace(tzinfo=user_tz)
-            .astimezone(pytz.utc)
-        )
+        timestamp = datetime.utcfromtimestamp(
+            int(row[AsTsvColumn["TIMESTAMP"].value])
+        ).replace(tzinfo=user_tz)
 
         new_scrobble = Scrobble(
             user_id=user_id,