reorg, remove old music slice files

This commit is contained in:
austinried
2022-03-20 16:16:16 +09:00
parent 2969b6c768
commit ba37348fc3
23 changed files with 139 additions and 345 deletions

View File

@@ -1,4 +1,4 @@
import { Album, PlaylistListItem, Artist, Song } from './music'
import { Album, Playlist, Artist, Song } from './library'
export enum CacheItemType {
coverArt = 'coverArt',
@@ -27,7 +27,7 @@ export type DownloadedAlbum = Album & {
songs: string[]
}
export type DownloadedPlaylist = PlaylistListItem & {
export type DownloadedPlaylist = Playlist & {
songs: string[]
}

View File

@@ -6,7 +6,12 @@ export interface Artist {
coverArt?: string
}
export interface AlbumListItem {
export interface ArtistInfo {
id: string
largeImageUrl?: string
}
export interface Album {
itemType: 'album'
id: string
name: string
@@ -14,14 +19,10 @@ export interface AlbumListItem {
artistId?: string
starred?: Date
coverArt?: string
}
export interface Album extends AlbumListItem {
coverArt?: string
year?: number
}
export interface PlaylistListItem {
export interface Playlist {
itemType: 'playlist'
id: string
name: string
@@ -41,11 +42,15 @@ export interface Song {
discNumber?: number
duration?: number
starred?: Date
// streamUri: string
coverArt?: string
}
export type ListableItem = Song | AlbumListItem | Artist | PlaylistListItem
export interface SearchResults {
artists: string[]
albums: string[]
songs: string[]
}
export type StarrableItemType = 'song' | 'album' | 'artist'
export type StarrableItemType = 'album' | 'song' | 'artist'
export type ListableItem = Album | Song | Artist | Playlist

14
app/models/state.ts Normal file
View File

@@ -0,0 +1,14 @@
export interface ById<T> {
[id: string]: T
}
export type OneToMany = ById<string[]>
export interface OrderedById<T> {
byId: ById<T>
allIds: string[]
}
export interface PaginatedList {
[offset: number]: string[]
}