subtracks/app/models/cache.ts
austinried 79a42b9adb swtiched back to 2 sizes for images
siwtched to Image for now to avoid double caching from FastImage
2021-08-19 11:21:53 +09:00

40 lines
763 B
TypeScript

import { Album, PlaylistListItem, Artist, Song } from './music'
export enum CacheItemType {
coverArt = 'coverArt',
coverArtThumb = 'coverArtThumb',
artistArt = 'artistArt',
artistArtThumb = 'artistArtThumb',
song = 'song',
}
export type CacheItemTypeKey = keyof typeof CacheItemType
export type CacheImageSize = 'thumbnail' | 'original'
export type CacheFile = {
path: string
date: number
permanent: boolean
}
export type CacheRequest = {
progress: number
promise?: Promise<void>
}
export type DownloadedAlbum = Album & {
songs: string[]
}
export type DownloadedPlaylist = PlaylistListItem & {
songs: string[]
}
export type DownloadedArtist = Artist & {
topSongs: string[]
albums: string[]
}
export type DownloadedSong = Song