swtiched back to 2 sizes for images

siwtched to Image for now to avoid double caching from FastImage
This commit is contained in:
austinried
2021-08-19 11:21:53 +09:00
parent 25b95a4b65
commit 79a42b9adb
12 changed files with 155 additions and 116 deletions

39
app/models/cache.ts Normal file
View File

@@ -0,0 +1,39 @@
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

View File

@@ -8,6 +8,7 @@ export interface Artist {
export interface ArtistInfo extends Artist {
albums: Album[]
smallImageUrl?: string
largeImageUrl?: string
topSongs: Song[]
}
@@ -70,37 +71,3 @@ export type ListableItem = Song | AlbumListItem | Artist | PlaylistListItem
export type HomeLists = { [key: string]: AlbumListItem[] }
export type StarrableItemType = 'song' | 'album' | 'artist'
export enum CacheItemType {
coverArt = 'coverArt',
artistArt = 'artistArt',
song = 'song',
}
export type CacheItemTypeKey = keyof typeof CacheItemType
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