Skip to content

Commit

Permalink
do not store tracks that could not be loaded to local library
Browse files Browse the repository at this point in the history
  • Loading branch information
geo-martino committed Dec 2, 2024
1 parent 111a41a commit c21cf0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/info/release-history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Changed
Fixed
-----
* Drop ``null`` responses from Spotify API which cause bugs in execution logic
* Bug in :py:meth:`.LocalLibrary.load_tracks` that would cause it to store ``None`` when the track could not be loaded


1.1.10
Expand Down
3 changes: 2 additions & 1 deletion musify/libraries/local/library/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ async def load_tracks(self) -> None:
unit="tracks",
total=len(self._track_paths)
)
self._tracks = [await self.load_track(path) for path in bar]
tracks = (await self.load_track(path) for path in bar)
self._tracks = [track for track in tracks if track is not None]

self._log_errors("Could not load the following tracks")
self.logger.debug(f"Load {self.name} tracks: DONE\n")
Expand Down

0 comments on commit c21cf0d

Please sign in to comment.