-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kutu
committed
Apr 22, 2024
1 parent
b36316d
commit 0d1169c
Showing
15 changed files
with
699 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import TYPE_CHECKING | ||
|
||
# Avoid circular import error | ||
from .artist import Artist | ||
from .model import Model | ||
|
||
if TYPE_CHECKING: | ||
from ..subsonic import Subsonic | ||
|
||
|
||
class Contributor(Model): | ||
def __init__( | ||
self, | ||
subsonic: "Subsonic", | ||
role: str, | ||
artist: Artist, | ||
subRole: str | None = None, | ||
) -> None: | ||
super().__init__(subsonic) | ||
|
||
self.role = role | ||
self.subrole = subRole | ||
self.artist = artist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from typing import TYPE_CHECKING, Any | ||
|
||
from .model import Model | ||
from .song import Song | ||
from .user import User | ||
|
||
if TYPE_CHECKING: | ||
from ..subsonic import Subsonic | ||
|
||
|
||
class NowPlayingEntry(Model): | ||
def __init__( | ||
self, | ||
subsonic: "Subsonic", | ||
username: str, | ||
minutesAgo: int | None = None, | ||
playerId: int | None = None, | ||
playerName: str | None = None, | ||
**song_data: Any, | ||
) -> None: | ||
super().__init__(subsonic) | ||
|
||
self.user = User(self._subsonic, username) | ||
self.minutes_ago = minutesAgo | ||
self.player_id = playerId | ||
self.player_name = playerName | ||
self.song = Song(subsonic=self._subsonic, **song_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from typing import TYPE_CHECKING | ||
|
||
# Avoid circular import error | ||
from .model import Model | ||
|
||
if TYPE_CHECKING: | ||
from ..subsonic import Subsonic | ||
|
||
|
||
class ReplayGain(Model): | ||
def __init__( | ||
self, | ||
subsonic: "Subsonic", | ||
trackGain: str | None = None, | ||
albumGain: str | None = None, | ||
trackPeak: str | None = None, | ||
albumPeak: str | None = None, | ||
baseGain: str | None = None, | ||
) -> None: | ||
super().__init__(subsonic) | ||
|
||
self.track_gain = trackGain | ||
self.album_gain = albumGain | ||
self.track_peak = trackPeak | ||
self.album_peak = albumPeak | ||
self.base_gain = baseGain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from typing import TYPE_CHECKING, Any | ||
|
||
from knuckles.models.model import Model | ||
|
||
from .album import Album | ||
from .artist import Artist | ||
from .song import Song | ||
|
||
if TYPE_CHECKING: | ||
from ..subsonic import Subsonic | ||
|
||
|
||
class StarredContent(Model): | ||
def __init__( | ||
self, | ||
subsonic: "Subsonic", | ||
song: list[dict[str, Any]] | None = None, | ||
album: list[dict[str, Any]] | None = None, | ||
artist: list[dict[str, Any]] | None = None, | ||
) -> None: | ||
super().__init__(subsonic) | ||
|
||
self.songs = ( | ||
[Song(subsonic=self._subsonic, **song) for song in song] if song else None | ||
) | ||
self.albums = ( | ||
[Album(subsonic=self._subsonic, **album) for album in album] | ||
if album | ||
else None | ||
) | ||
self.artists = ( | ||
[Artist(subsonic=self._subsonic, **artist) for artist in artist] | ||
if artist | ||
else None | ||
) |
Oops, something went wrong.