Skip to content

Commit 8408a93

Browse files
committed
Chore: add temp convert for streamtype in streamdetails for older api clients
1 parent 2743694 commit 8408a93

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

music_assistant_models/streamdetails.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,11 @@ def __str__(self) -> str:
178178
def uri(self) -> str:
179179
"""Return uri representation of item."""
180180
return f"{self.provider}://{self.media_type.value}/{self.item_id}"
181+
182+
def __post_serialize__(self, d: dict[Any, Any]) -> dict[Any, Any]:
183+
"""Execute action(s) on serialization."""
184+
# TEMP 2025-02-28: convert StreamType.CACHE_FILE for
185+
# backwards compatibility with older client versions
186+
# Remove this in a future release
187+
d["stream_type"] = d["stream_type"].replace("cache_file", "local_file")
188+
return d

0 commit comments

Comments
 (0)