Skip to content

Commit

Permalink
Merge pull request #17 from Fahmula/dev
Browse files Browse the repository at this point in the history
Fix handling of unknown runtime ticks
  • Loading branch information
Fahmula authored Apr 22, 2024
2 parents b594966 + 1952b89 commit 7cd2e19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def process_payload(item_id):

if item_type == "Movie":
if not item_already_notified(item_name, release_year):
runtime_ticks = item_details["Items"][0].get("RunTimeTicks", "Unknown")
runtime_sec = runtime_ticks // 10_000_000
runtime_ticks = item_details["Items"][0].get("RunTimeTicks")
runtime_sec = runtime_ticks // 10_000_000 if runtime_ticks is not None else "Unknown"
hours, remainder = divmod(runtime_sec, 3600)
minutes, seconds = divmod(remainder, 60)
runtime = "{:02}:{:02}:{:02}".format(hours, minutes, seconds)
Expand Down

0 comments on commit 7cd2e19

Please sign in to comment.