From 367d41f2be8e302299ac1054fe7f743e928f3369 Mon Sep 17 00:00:00 2001 From: meeb Date: Tue, 15 Feb 2022 17:44:13 +1100 Subject: [PATCH] fix tests --- tubesync/sync/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index 02ea10e..f65611f 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -1000,7 +1000,9 @@ class Media(models.Model): def duration(self): field = self.get_metadata_field('duration') duration = self.loaded_metadata.get(field, 0) - if not isinstance(duration, int): + try: + duration = int(duration) + except ValueError: duration = 0 return duration