From e79ef640becb4b59dba11c1dfcce0ea87000919b Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Tue, 5 Jun 2018 17:26:04 +0200 Subject: [PATCH 1/1] fix to pass tests --- src/catalogue/models/book.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 004c27e89..7cd6386ba 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -233,7 +233,7 @@ class Book(models.Model): def get_audio_length(self): from mutagen.mp3 import MP3 total = 0 - for media in self.get_mp3(): + for media in self.get_mp3() or (): audio = MP3(media.file.path) total += audio.info.length return int(total) -- 2.20.1