Something went wrong. Try again.
a simple but full-featured web player for OpenSubsonic music servers (Navidrome, Gonic, Ampache, etc) devins.page/tinysub
svelte typescript javascript subsonic gonic navidrome
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196export interface Artist { id: string; name: string; sortName?: string; disambiguation?: string; coverArt?: string; starred?: string; userRating?: number; albumCount?: number;}
export interface Album { id: string; name: string; sortName?: string; song?: Song | Song[]; coverArt?: string; artistId?: string; artist?: string; displayArtist?: string; year?: number; genre?: string; genres?: { name: string }[]; starred?: string; userRating?: number; playCount?: number;}
export interface ArtistWithAlbums extends Artist { album?: Album | Album[];}
interface InfoBase { musicBrainzId?: string; lastFmUrl?: string; smallImageUrl?: string; mediumImageUrl?: string; largeImageUrl?: string;}
export interface AlbumInfo extends InfoBase { notes?: string;}
interface SimilarArtist { id: string; name: string; coverArt?: string; disambiguation?: string;}
export interface ArtistInfo extends InfoBase { biography?: string; similarArtist?: SimilarArtist[];}
export interface InfoResponse { artist?: ArtistWithAlbums; album?: Album; song?: Song;}
export interface Playlist { id: string; name: string; coverArt?: string; readonly?: boolean; owner?: string; public?: boolean;}
export interface Share { id: string; url: string; coverArt?: string; description?: string; username: string; created: string; visitCount: number; expires?: string; entry?: Song[];}
interface LyricsLine { start: string; value: string;}
export interface LyricsResponse { lyrics?: { value?: string } | string; lyricsList?: { structuredLyrics?: Array<{ synced?: boolean; line?: LyricsLine[]; }>; };}
export interface Song { id: string; title: string; sortName?: string; artist: string; displayArtist?: string; artists?: { id: string; name: string }[]; album: string; genre?: string; genres?: { name: string }[]; duration?: number; coverArt?: string; albumId?: string; artistId?: string; albumArtist?: string; albumArtistId?: string; displayAlbumArtist?: string; albumArtists?: { id: string; name: string }[]; starred?: string; userRating?: number; discNumber?: number; track?: number; year?: number; musicBrainzId?: string; playCount?: number; playcount?: number; bitRate?: number; contentType?: string; suffix?: string; replayGain?: { trackGain?: number; albumGain?: number; trackPeak?: number; albumPeak?: number; baseGain?: number; fallbackGain?: number; }; lyrics?: LyricsResponse; accessed?: number; _origStarred?: string; _origUserRating?: number; _radioStreamUrl?: string;}
export interface InternetRadioStation { id: string; name: string; streamUrl: string; homePageUrl?: string; coverArt?: string;}
export interface ServerSong extends Song { replayGainTrackGain?: number; replayGainAlbumGain?: number; replayGainTrackPeak?: number; replayGainAlbumPeak?: number; replayGainBaseGain?: number; replayGainFallbackGain?: number;}
export interface ScanStatus { scanning: boolean; count?: number;}
export type PlaybackReportState = "starting" | "playing" | "paused" | "stopped";
export type InfoItemType = | "artist" | "album" | "playlist" | "radio" | "song" | "share";
export type InfoItem = { type: InfoItemType; id: string; label: string;};
export const trackInfoItem = (track: Song, radio = false): InfoItem => { return { type: radio ? "radio" : "song", id: track.id, label: track.title, };};
export const isInfoItemType = (type: string): type is InfoItemType => type === "artist" || type === "album" || type === "playlist" || type === "radio" || type === "song" || type === "share";