Browse Source

Store duration in metadata as int instead of str

This will be a lot more flexible if we want to allow
filtering/searching/etc. based on durations.
merge-requests/55/head
Deimos 6 years ago
parent
commit
3e65ff77d8
  1. 5
      tildes/tildes/scrapers/youtube_scraper.py

5
tildes/tildes/scrapers/youtube_scraper.py

@ -115,9 +115,6 @@ class YoutubeScraper:
seconds=duration_components["seconds"],
)
# string version of timedelta always has hours, strip it off when it's zero
duration = str(delta).lstrip("0:")
metadata["duration"] = duration
metadata["duration"] = int(delta.total_seconds())
return metadata
Loading…
Cancel
Save