subtracks/app/models/settings.ts
Theo Salzmann 9a6f8b86fc
FEATURE: add plain text password toggle to settings (#22)
* FEATURE: add plain text password toggle to settings

* clean up state types, lint, and add migrate

Co-authored-by: austinried <4966622+austinried@users.noreply.github.com>
2021-12-03 15:18:05 +09:00

53 lines
994 B
TypeScript

import { GetAlbumList2Type } from '@app/subsonic/params'
export type Server = (TokenPassword | PlainPassword) & {
id: string
address: string
username: string
usePlainPassword: boolean
}
interface PlainPassword {
usePlainPassword: true
plainPassword: string
}
interface TokenPassword {
usePlainPassword: false
token: string
salt: string
}
export interface AlbumFilterSettings {
type: GetAlbumList2Type
fromYear: number
toYear: number
genre: string
}
export type ArtistFilterType = 'random' | 'starred' | 'alphabeticalByName'
export interface ArtistFilterSettings {
type: ArtistFilterType
}
export interface AppSettings {
servers: Server[]
screens: {
home: {
lists: string[]
}
library: {
albums: AlbumFilterSettings
artists: ArtistFilterSettings
}
}
activeServer?: string
scrobble: boolean
estimateContentLength: boolean
maxBitrateWifi: number
maxBitrateMobile: number
minBuffer: number
maxBuffer: number
}