Add Data types to opensubsonic module

This commit is contained in:
Neshura 2024-04-29 07:11:21 +02:00
parent fc382d6876
commit b0ec1c7d56
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -76,4 +76,176 @@ export module OpenSubsonic {
Cookies.set("subsonicSalt", salt, options); Cookies.set("subsonicSalt", salt, options);
Cookies.set("subsonicUsername", username, 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<ItemGenre>,
artists?: Array<ArtistID3>,
displayArtist?: string,
albumArtists?: Array<ArtistID3>,
displayAlbumArtist?: string,
contributors?: Array<Contributor>
displayComposer?: string,
moods?: Array<string>,
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<NowPlayingEntry>
}
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<AlbumID3>
}
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<RecordLabel>,
musicBrainzId?: string,
genres?: Array<ItemGenre>,
artists?: Array<ArtistID3>,
displayArtist?: string,
releaseTypes?: Array<string>,
moods?: Array<string>,
sortName?: string,
originalReleaseDate?: ItemDate,
releaseDate?: ItemDate,
isCompilation?: boolean,
discTitles?: Array<DiscTitle>
}
interface RecordLabel {
name: string
}
interface ArtistID3 {
id: string,
name: string,
coverArt?: string,
artistImageUrl?: string,
albumCount?: number,
starred?: string,
musicBrainzId?: string,
sortName?: string,
roles?: Array<string>
}
interface Contributor {
role: string,
subRole?: string,
artist: ArtistID3,
}
interface ItemDate {
year?: number,
month?: number,
day?: number,
}
interface DiscTitle {
disc: number,
title: string,
} }