Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions mopidy_local/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,17 @@ def _scan_metadata(
logger.warning(
f"Failed scanning {file_uri}: No audio found in file"
)
elif result.duration is None:
logger.warning(
f"Failed scanning {file_uri}: "
"No duration information found in file"
)
elif result.duration < MIN_DURATION_MS:
elif result.duration and result.duration < MIN_DURATION_MS:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case, this change will now let duration 0 pass and skip through all checks because it's not None and it's falsey

logger.warning(
f"Failed scanning {file_uri}: "
f"Track shorter than {MIN_DURATION_MS}ms"
)
else:
if result.duration is None:
logger.warning(
f"Failed scanning {file_uri}: "
"proceeding without duration information"
)
local_uri = translator.path_to_local_track_uri(
absolute_path, media_dir
)
Expand Down