]> git.0d.be Git - django-panik-nonstop.git/commitdiff
airtime tracker: skip full shows
authorFrédéric Péters <fpeters@0d.be>
Sun, 5 Feb 2023 09:44:20 +0000 (10:44 +0100)
committerFrédéric Péters <fpeters@0d.be>
Sun, 5 Feb 2023 09:44:20 +0000 (10:44 +0100)
nonstop/management/commands/airtime_tracker.py

index fc1042191f685e5ee1668631cf231fc7e458316d..e4eb4011864238333ad75ddd8ea0b39e740c9d67 100644 (file)
@@ -62,6 +62,8 @@ class Command(BaseCommand):
                     duration = parse_duration(metadata.get('length'))
                     if duration < datetime.timedelta(seconds=30):
                         continue  # skip what's probably a jingle
+                    if duration > datetime.timedelta(seconds=3000):
+                        continue  # skip what's probably a full show
                     if metadata.get('artist_name'):
                         artist, created = Artist.objects.get_or_create(
                             name=html.unescape(metadata.get('artist_name'))