Fix linter errors
This commit is contained in:
@@ -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)
|
||||
|
@@ -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
|
||||
|
@@ -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(
|
||||
|
Reference in New Issue
Block a user