Skip to content

Commit

Permalink
Jellyfin: Typing improvements (#1371)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jc2k authored Jun 17, 2024
1 parent de95ebf commit 3112894
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 150 deletions.
4 changes: 2 additions & 2 deletions music_assistant/common/models/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ class ContentType(StrEnum):
UNKNOWN = "?"

@classmethod
def _missing_(cls: Self, value: object) -> Self: # noqa: ARG003
def _missing_(cls, value: object) -> Self: # noqa: ARG003
"""Set default enum member if an unknown value is provided."""
return cls.UNKNOWN

@classmethod
def try_parse(cls: Self, string: str) -> Self:
def try_parse(cls, string: str) -> Self:
"""Try to parse ContentType from (url)string/extension."""
tempstr = string.lower()
if "audio/" in tempstr:
Expand Down
Loading

0 comments on commit 3112894

Please sign in to comment.