Revert "добавлены исключения при присутствии в моделях Album, Trak, Artist, Cover поля error (в данном случае сервер отдаёт 200 и от модели возвращается только поле ID)"
This reverts commit 30a101d2f7
.
このコミットが含まれているのは:
コミット
59e8174389
|
@ -1,7 +1,6 @@
|
|||
from typing import Any, TYPE_CHECKING, Optional, List, Union
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
from yandex_music.exceptions import YandexMusicError
|
||||
from yandex_music.utils import model
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
@ -118,9 +117,6 @@ class Album(YandexMusicObject):
|
|||
client: Optional['Client'] = None
|
||||
|
||||
def __post_init__(self):
|
||||
if self.error:
|
||||
raise YandexMusicError(self.error)
|
||||
|
||||
self._id_attrs = (self.id,)
|
||||
|
||||
def with_tracks(self, *args, **kwargs) -> Optional['Album']:
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from typing import Any, TYPE_CHECKING, Optional, List, Union
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
from yandex_music.exceptions import YandexMusicError
|
||||
from yandex_music.utils import model
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
@ -80,9 +79,6 @@ class Artist(YandexMusicObject):
|
|||
client: 'Client' = None
|
||||
|
||||
def __post_init__(self):
|
||||
if self.error:
|
||||
raise YandexMusicError(self.error)
|
||||
|
||||
self._id_attrs = (self.id, self.name, self.cover)
|
||||
|
||||
def download_og_image(self, filename: str, size: str = '200x200') -> None:
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
from yandex_music.exceptions import YandexMusicError
|
||||
from yandex_music.utils import model
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
@ -41,9 +40,6 @@ class Cover(YandexMusicObject):
|
|||
client: Optional['Client'] = None
|
||||
|
||||
def __post_init__(self):
|
||||
if self.error:
|
||||
raise YandexMusicError(self.error)
|
||||
|
||||
self._id_attrs = (self.prefix, self.version, self.uri, self.items_uri)
|
||||
|
||||
def download(self, filename: str, index: int = 0, size: str = '200x200') -> None:
|
||||
|
|
|
@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Optional, List, Union
|
|||
|
||||
from yandex_music import YandexMusicObject
|
||||
from yandex_music.utils import model
|
||||
from yandex_music.exceptions import InvalidBitrateError, YandexMusicError
|
||||
from yandex_music.exceptions import InvalidBitrateError
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import (
|
||||
|
@ -70,10 +70,10 @@ class Track(YandexMusicObject):
|
|||
preview_duration_ms (:obj:`int`, optional): TODO.
|
||||
available_full_without_permission (:obj:`bool`, optional): Доступен ли без подписки.
|
||||
version (:obj:`str`, optional): Версия.
|
||||
remember_position (:obj:`bool`, optional): Если :obj:`True`, то запоминается последняя позиция прослушивания,
|
||||
remember_position (:obj:`bool`, optional): Если :obj:`True`, то запоминатся последняя позиция прослушивания,
|
||||
иначе позиция не запоминается.
|
||||
background_video_uri (:obj:`str`, optional): Ссылка на видеошот.
|
||||
short_description (:obj:`str`, optional): Краткое описание эпизода подкаста.
|
||||
short_description (:obj:`str`, optional): Краткое опсание эпизода подкаста.
|
||||
is_suitable_for_children (:obj:`bool`, optional): Подходит ли для детей TODO.
|
||||
client (:obj:`yandex_music.Client`): Клиент Yandex Music.
|
||||
"""
|
||||
|
@ -119,9 +119,6 @@ class Track(YandexMusicObject):
|
|||
client: Optional['Client'] = None
|
||||
|
||||
def __post_init__(self):
|
||||
if self.error:
|
||||
raise YandexMusicError(self.error)
|
||||
|
||||
self.download_info = None
|
||||
self._id_attrs = (self.id,)
|
||||
|
||||
|
|
読み込み中…
新しいイシューから参照