Move bases to bases.py, add support for Qobuz booklets; #53

This commit is contained in:
nathom 2021-04-17 12:53:29 -07:00
parent 40f28c1398
commit b0f6e7b197
3 changed files with 842 additions and 791 deletions

View file

@ -1,5 +1,4 @@
"""Manages the information that will be embeded in the audio file. """
import logging
import re
from collections import OrderedDict
@ -23,7 +22,7 @@ logger = logging.getLogger(__name__)
class TrackMetadata:
"""Contains all of the metadata needed to tag the file.
Available attributes:
Tags contained:
* title
* artist
@ -81,6 +80,7 @@ class TrackMetadata:
self.quality = None
self.sampling_rate = None
self.bit_depth = None
self.booklets = None
# Internals
self._artist = None
@ -149,6 +149,7 @@ class TrackMetadata:
self.bit_depth = resp.get("maximum_bit_depth")
self.sampling_rate = resp.get("maximum_sampling_rate")
self.quality = get_quality_id(self.bit_depth, self.sampling_rate)
self.booklets = resp.get("goodies")
if self.sampling_rate is not None:
self.sampling_rate *= 1000