diff --git a/streamrip/bases.py b/streamrip/bases.py index 89f3c8a..fd402d0 100644 --- a/streamrip/bases.py +++ b/streamrip/bases.py @@ -656,6 +656,14 @@ class Video: return False # so that it is not tagged + def tag(self, *args, **kwargs): + """Dummy method. + + :param args: + :param kwargs: + """ + return False + @classmethod def from_album_meta(cls, track: dict, client: Client): """Given an video response dict from an album, return a new @@ -787,7 +795,7 @@ class Tracklist(list): if self._download_item(item, **kwargs): item.convert(**kwargs["conversion"]) - def _download_item(item, **kwargs): + def _download_item(item, *args: Any, **kwargs: Any) -> bool: """Abstract method. :param item: diff --git a/streamrip/metadata.py b/streamrip/metadata.py index 0a4e2f5..7fb7d16 100644 --- a/streamrip/metadata.py +++ b/streamrip/metadata.py @@ -62,7 +62,7 @@ class TrackMetadata: self.title: str self.album: str self.albumartist: str - self.composer: str + self.composer: Optional[str] = None self.comment: Optional[str] = None self.description: Optional[str] = None self.purchase_date: Optional[str] = None diff --git a/streamrip/tracklists.py b/streamrip/tracklists.py index 9a95095..11444fd 100644 --- a/streamrip/tracklists.py +++ b/streamrip/tracklists.py @@ -9,7 +9,7 @@ import logging import os import re from tempfile import gettempdir -from typing import Dict, Generator, Iterable, Union +from typing import Dict, Generator, Iterable, Union, Optional import click from pathvalidate import sanitize_filename @@ -54,8 +54,11 @@ class Album(Tracklist): self.sampling_rate = None self.bit_depth = None - self.container = None + self.container: Optional[str] = None + self.disctotal: int + self.tracktotal: int + self.albumartist: str # usually an unpacked TrackMetadata.asdict() self.__dict__.update(kwargs) @@ -148,7 +151,7 @@ class Album(Tracklist): for item in self.booklets: Booklet(item).download(parent_folder=self.folder) - def _download_item( + def _download_item( # type: ignore self, track: Union[Track, Video], quality: int = 3, @@ -411,7 +414,7 @@ class Playlist(Tracklist): self.__download_index = 1 # used for tracknumbers self.download_message() - def _download_item(self, item: Track, **kwargs): + def _download_item(self, item: Track, **kwargs) -> bool: # type: ignore kwargs["parent_folder"] = self.folder if self.client.source == "soundcloud": item.load_meta() @@ -578,7 +581,7 @@ class Artist(Tracklist): self.download_message() return final - def _download_item( + def _download_item( # type: ignore self, item, parent_folder: str = "StreamripDownloads",