Browse Source

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

Colin Powell 1 năm trước cách đây
mục cha
commit
bcf2b9d1ea
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  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,