Skip to content

Commit

Permalink
Fixed bug when playing ads over 30 seconds
Browse files Browse the repository at this point in the history
Because there is no way to get the length of an ad, the app just assumes every ad 30 seconds long.
This would cause a crash when an ad over 30 seconds would play.
  • Loading branch information
Mews committed May 17, 2024
1 parent 3ba7963 commit 55d8b23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ def __init__(self, *args, **kwargs):
self.length_lbl.pack(side=LEFT, padx=8)

def update_progress(self, progress:timedelta, length:timedelta):
progress_seconds = progress.total_seconds()
length_seconds = length.total_seconds()
progress_seconds = min(progress.total_seconds(), length_seconds)

value = (progress_seconds/length_seconds)*100
self.progress_bar.config(value=value)
Expand Down

0 comments on commit 55d8b23

Please sign in to comment.