Find the current song's URL and pass it on when possible
This commit is contained in:
parent
b8bcdc5a83
commit
d9c8e0fe28
9 changed files with 79 additions and 21 deletions
|
|
@ -3,6 +3,7 @@ from pathlib import Path
|
|||
import ormsgpack
|
||||
from websockets import broadcast
|
||||
from websockets.server import WebSocketServerProtocol, serve
|
||||
from yarl import URL
|
||||
|
||||
from ...config.model import WebsocketsReceiverConfig
|
||||
from ...player import Player
|
||||
|
|
@ -15,6 +16,8 @@ MSGPACK_NULL = ormsgpack.packb(None)
|
|||
def default(value: object) -> object:
|
||||
if isinstance(value, Path):
|
||||
return str(value)
|
||||
if isinstance(value, URL):
|
||||
return value.human_repr()
|
||||
raise TypeError
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue