Verified Commit b63edd84 authored by Sumner Evans's avatar Sumner Evans 💬

Force stringify of IDs from Subsonic servers

parent d945416f
Pipeline #194072644 passed with stages
in 21 minutes and 57 seconds
# Run poetry install and activate the virtualenv
poetry install
poetry install -E chromecast -E keyring -E server
source .venv/bin/activate
watch_file pyproject.toml
......
......@@ -158,6 +158,8 @@ class Directory(SublimeAPI.Directory):
)
def __post_init__(self):
if not isinstance(self.id, str):
self.id = str(self.id)
self.parent_id = (self.parent_id or "root") if self.id != "root" else None
self.name = self.name or self.title
......@@ -199,6 +201,8 @@ class Song(SublimeAPI.Song, DataClassJsonMixin):
starred: Optional[datetime] = None
def __post_init__(self):
if not isinstance(self.id, str):
self.id = str(self.id)
self.parent_id = (self.parent_id or "root") if self.id != "root" else None
self.artist = (
None
......@@ -227,6 +231,8 @@ class Playlist(SublimeAPI.Playlist):
cover_art: Optional[str] = None
def __post_init__(self):
if not isinstance(self.id, str):
self.id = str(self.id)
if self.songs is None:
return
if self.song_count is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment