Skip to content

Commit

Permalink
Merge pull request #726 from tcely/patch-4
Browse files Browse the repository at this point in the history
Handle `None` in `video["duration"]`
  • Loading branch information
meeb authored Feb 16, 2025
2 parents 94cd38a + 1f3cf1c commit 16fd318
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tubesync/sync/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def index_source_task(source_id):
except Media.DoesNotExist:
media = Media(key=key)
media.source = source
media.duration = float(video.get(fields('duration', media), 0)) or None
media.duration = float(video.get(fields('duration', media), None) or 0) or None
media.title = str(video.get(fields('title', media), ''))[:200]
timestamp = video.get(fields('timestamp', media), None)
if timestamp is not None:
Expand Down

0 comments on commit 16fd318

Please sign in to comment.