diff --git a/src/lib/opensubsonic.ts b/src/lib/opensubsonic.ts index 82ccacf..d68cca5 100644 --- a/src/lib/opensubsonic.ts +++ b/src/lib/opensubsonic.ts @@ -76,4 +76,176 @@ export module OpenSubsonic { Cookies.set("subsonicSalt", salt, options); Cookies.set("subsonicUsername", username, options); } +} + +export interface Parameter { + key: string, + value: string +} + +interface OpenSubsonicResponse { + status: string, + version: string, + type: string, + serverVersion: string, + openSubsonic: boolean, +} + +export interface Song { + id: string, + parent?: string, + isDir: boolean, + title?: string, + album?: string, + artist?: string, + track?: number, + year?: number, + genre?: string, + coverArt?: string, + size?: number, + contentType?: string, + suffix?: string, + transcodedContentType?: string, + transcodedSuffix?: string, + duration?: number, + bitRate?: number, + bitDepth?: number, + samplingRate?: number, + channelCount?: number, + bitRate?: number, + path?: string, + isVideo?: boolean, + userRating?: number, + averageRating?: number, + playCount?: number, + discNumber?: number, + created?: string, + starred?: string, + albumId?: string, + artistId?: string, + type?: string, + mediaType?: string, + bookmarkPosition?: number, + originalWidth?: number, + originalHeight?: number, + played?: string, + bpm?: number, + comment?: string, + sortName?: string, + musicBrainzId?: string, + genres?: Array, + artists?: Array, + displayArtist?: string, + albumArtists?: Array, + displayAlbumArtist?: string, + contributors?: Array + displayComposer?: string, + moods?: Array, + replayGain?: ReplayGain, +} + +export interface ItemGenre { + name: string +} + +export interface ReplayGain { + trackGain?: number, + albumGain?: number, + trackPeak?: number, + albumPeak?: number, + baseGain?: number, + fallbackGain?: number, +} + +export interface NowPlayingResponse extends OpenSubsonicResponse { + nowPlaying: NowPlaying +} + +interface NowPlaying { + entry: Array +} + +export interface NowPlayingEntry extends Song { + username: string, + minutesAgo?: string, + playerId?: number, + playerName?: string, +} + +export interface GetPlayQueueResponse extends OpenSubsonicResponse { + playQueue: PlayQueue +} + +interface PlayQueue extends NowPlaying { + dummy: string +} + +export interface GetAlbumList2Response extends OpenSubsonicResponse { + albumList2: AlbumList2 +} + +export interface AlbumList2 { + album: Array +} + +export interface AlbumID3 { + id: string, + name: string, + artist?: string, + artistId?: string, + coverArt?: string, + songCount: number, + duration: number, + playCount?: number, + created: string, + starred?: string, + year?: number, + genre?: string, + played?: string, + userRating?: number, + recordLabels?: Array, + musicBrainzId?: string, + genres?: Array, + artists?: Array, + displayArtist?: string, + releaseTypes?: Array, + moods?: Array, + sortName?: string, + originalReleaseDate?: ItemDate, + releaseDate?: ItemDate, + isCompilation?: boolean, + discTitles?: Array +} + +interface RecordLabel { + name: string +} + +interface ArtistID3 { + id: string, + name: string, + coverArt?: string, + artistImageUrl?: string, + albumCount?: number, + starred?: string, + musicBrainzId?: string, + sortName?: string, + roles?: Array +} + +interface Contributor { + role: string, + subRole?: string, + artist: ArtistID3, +} + +interface ItemDate { + year?: number, + month?: number, + day?: number, +} + +interface DiscTitle { + disc: number, + title: string, } \ No newline at end of file