Parcourir la source

[vidoes] default run time seconds to 1800

Colin Powell il y a 8 mois
Parent
commit
bfd6331be3
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      vrobbler/apps/videos/utils.py

+ 5 - 0
vrobbler/apps/videos/utils.py

@@ -64,6 +64,11 @@ def get_or_create_video(data_dict: dict, post_keys: dict, force_update=False):
 
         Video.objects.filter(pk=video.id).update(**video_dict)
         video.refresh_from_db()
+    # TODO this is a hack so we don't spam scrobbles without a run time seconds
+    if video.run_time_seconds == 0:
+        video.run_time_seconds = 1800
+        video.save(update_fields=["run_time_seconds"]
+
     return video