From 82a2a223655fb615be367bf3dccb8d963986ea5b Mon Sep 17 00:00:00 2001 From: ybnd Date: Sun, 12 Dec 2021 12:53:16 +0100 Subject: [PATCH] deezer: Tolerate missing fields when searching for singletons --- beetsplug/deezer.py | 6 +++--- docs/changelog.rst | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beetsplug/deezer.py b/beetsplug/deezer.py index 5f158f936..d21b1e9ed 100644 --- a/beetsplug/deezer.py +++ b/beetsplug/deezer.py @@ -128,9 +128,9 @@ class DeezerPlugin(MetadataSourcePlugin, BeetsPlugin): artist=artist, artist_id=artist_id, length=track_data['duration'], - index=track_data['track_position'], - medium=track_data['disk_number'], - medium_index=track_data['track_position'], + index=track_data.get('track_position'), + medium=track_data.get('disk_number'), + medium_index=track_data.get('track_position'), data_source=self.data_source, data_url=track_data['link'], ) diff --git a/docs/changelog.rst b/docs/changelog.rst index 8d95b7fb0..538a9d655 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,6 +11,9 @@ Bug fixes: * :doc:`/plugins/lyrics`: Fix Genius search by using query params instead of body. * :doc:`/plugins/unimported`: The new ``ignore_subdirectories`` configuration option added in 1.6.0 now has a default value if it hasn't been set. +* :doc:`/plugins/deezer`: Tolerate missing fields when searching for singleton + tracks + :bug:`4116` For packagers: