From cfe93c244b636ec3af9b3d9a0f3b850af2ab8917 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 20 Oct 2013 16:43:04 +0200 Subject: [PATCH] scanner: Reject files with <100ms audio data --- mopidy/scanner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mopidy/scanner.py b/mopidy/scanner.py index 3d2e6ddc..2e8876a2 100644 --- a/mopidy/scanner.py +++ b/mopidy/scanner.py @@ -212,8 +212,9 @@ class Scanner(object): data[b'uri'] = uri data[b'duration'] = info.get_duration() // gst.MSECOND - if data[b'duration'] == 0: - raise exceptions.ScannerError('Rejecting zero length audio.') + if data[b'duration'] < 100: + raise exceptions.ScannerError( + 'Rejecting file with less than 100ms audio data.') return data