Force stringify of IDs from Subsonic servers

This commit is contained in:
Sumner Evans
2020-09-24 08:18:39 -06:00
parent d945416f8c
commit b63edd84b2
2 changed files with 7 additions and 1 deletions

2
.envrc
View File

@@ -1,5 +1,5 @@
# 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

View File

@@ -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: