Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch timezone error for pre-epoch added_at on Windows #1875

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading