Skip to content
This repository was archived by the owner on Oct 20, 2018. It is now read-only.
Open
Changes from all 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
22 changes: 14 additions & 8 deletions gmusicapi_wrapper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def _get_mutagen_metadata(filepath):
logger.warning("Can't load {} as music file.".format(filepath))
raise

if metadata is None:
logger.warning("Can't load {} as music file.".format(filepath))

return metadata


Expand Down Expand Up @@ -288,15 +291,18 @@ def filter_local_songs(filepaths, include_filters=None, exclude_filters=None, al
except mutagen.MutagenError:
filtered_songs.append(filepath)
else:
if include_filters or exclude_filters:
if _check_filters(
song, include_filters=include_filters, exclude_filters=exclude_filters,
all_includes=all_includes, all_excludes=all_excludes):
matched_songs.append(filepath)
else:
filtered_songs.append(filepath)
if song is None:
filtered_songs.append(filepath)
else:
matched_songs.append(filepath)
if include_filters or exclude_filters:
if _check_filters(
song, include_filters=include_filters, exclude_filters=exclude_filters,
all_includes=all_includes, all_excludes=all_excludes):
matched_songs.append(filepath)
else:
filtered_songs.append(filepath)
else:
matched_songs.append(filepath)

return matched_songs, filtered_songs

Expand Down