From a8fb2db9f1675041a6d5b5d18be545793dbfff41 Mon Sep 17 00:00:00 2001 From: Suso Bravo Alvarez Date: Sun, 7 Feb 2021 20:40:42 +0100 Subject: [PATCH] Fix Track object generation It was trying to get "maximum_bit_depth" and "maximum_sampling_rate" from the album element in the track item. But currently those attributes come directly in the track item, and the album attribute no longer exists. --- src/qobuz/track.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qobuz/track.py b/src/qobuz/track.py index b00cce6..a707453 100644 --- a/src/qobuz/track.py +++ b/src/qobuz/track.py @@ -46,12 +46,8 @@ def __init__(self, track_item, album=None): self._performer_id = track_item.get("performer", {}).get("id") self._artist = None - maximum_bit_depth = track_item.get("album", {}).get( - "maximum_bit_depth" - ) - maximum_sampling_rate = track_item.get("album", {}).get( - "maximum_sampling_rate" - ) + maximum_bit_depth = track_item.get("maximum_bit_depth", 0) + maximum_sampling_rate = track_item.get("maximum_sampling_rate", 0) if maximum_bit_depth < 24: self.maximum_format_id = audio_format["flac"] elif maximum_sampling_rate <= 96: