local: Skip unplayable tracks

This commit is contained in:
Thomas Adamcik 2015-04-11 00:38:46 +02:00
parent 9bc4d8b713
commit 48a461991a

View File

@ -135,7 +135,9 @@ class ScanCommand(commands.Command):
file_uri = path.path_to_uri(os.path.join(media_dir, relpath))
result = scanner.scan(file_uri)
tags, duration = result.tags, result.duration
if duration < MIN_DURATION_MS:
if not result.playable:
logger.warning('Failed %s: No audio found in file.', uri)
elif duration < MIN_DURATION_MS:
logger.warning('Failed %s: Track shorter than %dms',
uri, MIN_DURATION_MS)
else: