Skip to content

Commit

Permalink
keep api backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Oct 21, 2024
1 parent 24a1449 commit 87e6d2d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions music_assistant/common/models/media_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ def __eq__(self, other: object) -> bool:
return False
return self.output_format_str == other.output_format_str

def __post_serialize__(self, d: dict[Any, Any]) -> dict[Any, Any]:
"""Execute action(s) on serialization."""
# bit_rate is now optional. Set default value to keep compatibility
# TODO: remove this after release of MA 2.5
d["bit_rate"] = d["bit_rate"] or 0
return d


@dataclass(kw_only=True)
class ProviderMapping(DataClassDictMixin):
Expand Down

0 comments on commit 87e6d2d

Please sign in to comment.