diff --git a/sublime/adapters/subsonic/api_objects.py b/sublime/adapters/subsonic/api_objects.py index dbd52e0..8bd700b 100644 --- a/sublime/adapters/subsonic/api_objects.py +++ b/sublime/adapters/subsonic/api_objects.py @@ -29,11 +29,15 @@ encoder_functions = { for type_, translation_function in decoder_functions.items(): dataclasses_json.cfg.global_config.decoders[type_] = translation_function - dataclasses_json.cfg.global_config.decoders[Optional[type_]] = translation_function + dataclasses_json.cfg.global_config.decoders[ + Optional[type_] # type: ignore + ] = translation_function for type_, translation_function in encoder_functions.items(): dataclasses_json.cfg.global_config.encoders[type_] = translation_function - dataclasses_json.cfg.global_config.encoders[Optional[type_]] = translation_function + dataclasses_json.cfg.global_config.encoders[ + Optional[type_] # type: ignore + ] = translation_function @dataclass_json(letter_case=LetterCase.CAMEL) diff --git a/sublime/config.py b/sublime/config.py index ce69301..2ac3a27 100644 --- a/sublime/config.py +++ b/sublime/config.py @@ -18,12 +18,17 @@ def encode_path(path: Path) -> str: dataclasses_json.cfg.global_config.decoders[Path] = Path -dataclasses_json.cfg.global_config.decoders[Optional[Path]] = ( +dataclasses_json.cfg.global_config.decoders[ + Optional[Path] # type: ignore +] = ( lambda p: Path(p) if p else None ) + dataclasses_json.cfg.global_config.encoders[Path] = encode_path -dataclasses_json.cfg.global_config.encoders[Optional[Path]] = encode_path +dataclasses_json.cfg.global_config.encoders[ + Optional[Path] # type: ignore +] = encode_path @dataclass diff --git a/sublime/players/chromecast.py b/sublime/players/chromecast.py index fe6f538..7063e72 100644 --- a/sublime/players/chromecast.py +++ b/sublime/players/chromecast.py @@ -1,5 +1,6 @@ import base64 import io +import logging import mimetypes import multiprocessing import os @@ -247,7 +248,7 @@ class ChromecastPlayer(Player): s.close() uri = f"http://{host_ip}:{self.config.get(LAN_PORT_KEY)}/s/{token.decode()}" - print(uri) + logging.info("Serving {song.name} at {uri}") cover_art_url = AdapterManager.get_cover_art_uri(song.cover_art, size=1000) self._current_chromecast.media_controller.play_media(