From dfb11601f4cb617281707486d886f01952e90ebb Mon Sep 17 00:00:00 2001 From: Max Goltzsche Date: Wed, 6 Dec 2023 01:52:44 +0100 Subject: [PATCH] Ignore None album_id within beets result This fixes a bug that prevented singleton (none-album) search results from showing up within mopidy. Fixes #39 Co-authored-by: Nick Steel --- mopidy_beets/translator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mopidy_beets/translator.py b/mopidy_beets/translator.py index be8126f..b243dd6 100644 --- a/mopidy_beets/translator.py +++ b/mopidy_beets/translator.py @@ -102,7 +102,7 @@ def parse_track(data, api): "name": "title", "artists": lambda d: _filter_none([parse_artist(d, "artist")]), "album": lambda d, api=api: ( - api.get_album(d["album_id"]) if "album_id" in d else None + api.get_album(d["album_id"]) if d.get("album_id") else None ), "composers": lambda d: _filter_none([parse_artist(d, "composer")]), "performers": None,