Skip to content

Commit

Permalink
Merge pull request #137 from eidoriantan/master
Browse files Browse the repository at this point in the history
Fix different timezone assertion
  • Loading branch information
dylanljones authored Feb 12, 2025
2 parents 7b4a27b + 3163b75 commit 1c9085d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyrekordbox/db6/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""Rekordbox 6 `master.db` SQLAlchemy table declarations."""

import math
import re
import struct
from datetime import datetime
from enum import IntEnum
Expand Down Expand Up @@ -118,7 +119,6 @@ class DateTime(TypeDecorator):
"""Custom datetime column with timezone support.
The datetime format in the database is `YYYY-MM-DD HH:MM:SS.SSS +00:00`.
The timezone seems to always be `+00:00` (UTC).
This format is not supported by the `DateTime` column of SQLAlchemy 2.
"""

Expand All @@ -137,7 +137,7 @@ def process_result_value(self, value, dialect):
datestr, tzinfo = value[:23], value[23:]
datestr = datestr.strip()
tzinfo = tzinfo.strip()
assert tzinfo == "+00:00", tzinfo
assert re.match(r"^\+\d{2}:\d{2}$", tzinfo)
else:
datestr, tzinfo = value, ""
dt = datetime.fromisoformat(datestr)
Expand Down

0 comments on commit 1c9085d

Please sign in to comment.