mirror of
https://github.com/beetbox/beets.git
synced 2026-02-12 02:12:10 +01:00
Allow handling of None
This commit is contained in:
parent
6d44c6af00
commit
272c7c32bc
2 changed files with 3 additions and 4 deletions
|
|
@ -204,9 +204,9 @@ def process_tracks(lib, tracks, log):
|
|||
|
||||
for num in range(0, total):
|
||||
song = None
|
||||
trackid = tracks[num]["mbid"].strip()
|
||||
artist = tracks[num]["artist"].get("name", "").strip()
|
||||
title = tracks[num]["name"].strip()
|
||||
trackid = tracks[num]["mbid"].strip() or None
|
||||
artist = tracks[num]["artist"].get("name", "").strip() or None
|
||||
title = tracks[num]["name"].strip() or None
|
||||
album = ""
|
||||
if "album" in tracks[num]:
|
||||
album = tracks[num]["album"].get("name", "").strip()
|
||||
|
|
|
|||
|
|
@ -145,7 +145,6 @@ class ListenBrainzPlugin(BeetsPlugin):
|
|||
if resp.get("recording-count") == "1":
|
||||
return resp.get("recording-list")[0].get("id")
|
||||
else:
|
||||
self._log.debug(f"Invalid Search Error: {resp}")
|
||||
return None
|
||||
|
||||
def get_playlists_createdfor(self, username):
|
||||
|
|
|
|||
Loading…
Reference in a new issue