From 67ab31003b44a2ad101b2063a71222df0998cb45 Mon Sep 17 00:00:00 2001 From: girst Date: Wed, 3 May 2023 19:30:28 +0000 Subject: [PATCH] fix bug in shorts detection logic a (potential) short was marked as False instead of None either of these situations: - length < 60 and aspect_ratio is None - length is None and aspect_ratio < 1 --- app/common/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/common/common.py b/app/common/common.py index 9223e64..38c37e4 100644 --- a/app/common/common.py +++ b/app/common/common.py @@ -367,9 +367,9 @@ def video_metadata(metadata): # shorts are <= 60 seconds and vertical or square. if we were unable to # determine it, we set it to None. is_short = ( - None if length is None and aspect_ratio is None else - True if ((length or 61) <= 60) and ((aspect_ratio or 2) <= 1) else - False # length > 60 or aspect_ratio > 1 + True if (length or 61) <= 60 and (aspect_ratio or 2) <= 1 else + False if (length or 0) > 60 or (aspect_ratio or 0) > 1 else + None ) # Note: 'premiere' videos have livestream=False and published= will be the -- 2.39.3