Skip to content

Commit

Permalink
bypass tz error for windows pre-epoch addedat
Browse files Browse the repository at this point in the history
  • Loading branch information
simonc56 committed Mar 23, 2024
1 parent 1584207 commit 3cabea7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plextraktsync/plex/PlexLibraryItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,12 @@ def show(self, show):
def date_value(date) -> datetime.datetime | None:
if not date:
return None

return date.astimezone(datetime.timezone.utc)
try:
return date.astimezone(datetime.timezone.utc)
except OSError:
# python on Windows cannot find tz for pre-epoch dates
# https://github.com/python/cpython/issues/80940
return date

@property
def title_link(self):
Expand Down

0 comments on commit 3cabea7

Please sign in to comment.