diff --git a/docs/release-history.rst b/docs/release-history.rst index fce7c7c0..64e545d6 100644 --- a/docs/release-history.rst +++ b/docs/release-history.rst @@ -31,6 +31,7 @@ Release History The format is based on `Keep a Changelog `_, and this project adheres to `Semantic Versioning `_ + 1.1.0 ===== @@ -39,6 +40,9 @@ Changed * :py:class:`.ItemDownloadHelper` only ever takes the first field when the singular name of a field is given and many values are available for that field. e.g. only ever takes the first artist when multiple artists are present and the requested field is 'artist' and not 'artists' +* :py:class:`.RemoteCollectionLoader` now inherits from :py:class:`.MusifyItem` interface. + The class already implemented all necessary methods for this interface and was always designed + to be an implementation of the :py:class:`.MusifyItem` interface. 1.0.2 @@ -72,6 +76,7 @@ Documentation ------------- * Mark release as stable/production. + 1.0.0 ===== @@ -183,6 +188,7 @@ Documentation * Updated how-to section to reflect implementation of async logic to underlying code * Created a how-to page for installation + 0.9.2 ===== diff --git a/musify/libraries/remote/core/object.py b/musify/libraries/remote/core/object.py index e83e0094..1e7f8074 100644 --- a/musify/libraries/remote/core/object.py +++ b/musify/libraries/remote/core/object.py @@ -37,7 +37,7 @@ class RemoteCollection[T: RemoteObject](MusifyCollection[T], metaclass=ABCMeta): __attributes_ignore__ = ("items", "track_total") -class RemoteCollectionLoader[T: RemoteObject](RemoteCollection[T], RemoteObject, metaclass=ABCMeta): +class RemoteCollectionLoader[T: RemoteObject](RemoteCollection[T], RemoteItem, metaclass=ABCMeta): """Generic class for storing a collection of remote objects that can be loaded from an API response.""" __slots__ = () diff --git a/musify/processors/download.py b/musify/processors/download.py index 057f5030..74663b53 100644 --- a/musify/processors/download.py +++ b/musify/processors/download.py @@ -8,7 +8,7 @@ from urllib.parse import quote from webbrowser import open as webopen -from musify.base import MusifyItem +from musify.base import MusifyItem, MusifyObject from musify.exception import MusifyEnumError from musify.field import Field, Fields from musify.libraries.core.collection import MusifyCollection @@ -76,8 +76,11 @@ def _open_sites_for_item(self, item: MusifyItem, fields: Iterable[Field]) -> boo if isinstance((value_many := getattr(item, field_name + "s", None)), (list, tuple)): value = next(iter(value_many)) - if isinstance(value, (tuple, set, list, dict)): - value = " ".join(value) + + if isinstance(value, MusifyObject): + value = value.name + elif isinstance(value, (tuple, set, list, dict)): + value = " ".join(v.name if isinstance(v, MusifyObject) else v for v in value) query_parts.append(str(value))