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

View File

@@ -118,6 +118,7 @@ const ArtistView = React.memo<{ id: string; title: string }>(({ id, title }) =>
onScroll={onScroll}>
<CoverArt
type="artist"
size="original"
artistId={artist.id}
style={styles.artistCover}
resizeMode={FastImage.resizeMode.cover}

View File

@@ -49,7 +49,7 @@ const AlbumListRenderItem: React.FC<{
const AlbumsList = () => {
const fetchAlbums = useStore(selectMusic.fetchAlbums)
const { list, refreshing, refresh, fetchNextPage } = useFetchPaginatedList(fetchAlbums, 60)
const { list, refreshing, refresh, fetchNextPage } = useFetchPaginatedList(fetchAlbums, 300)
const layout = useWindowDimensions()
@@ -69,7 +69,8 @@ const AlbumsList = () => {
onRefresh={refresh}
overScrollMode="never"
onEndReached={fetchNextPage}
onEndReachedThreshold={1}
onEndReachedThreshold={6}
disableVirtualization={true}
getItemLayout={(_data, index) => ({
length: height,
offset: height * Math.floor(index / 3),

View File

@@ -95,7 +95,7 @@ const SongCoverArt = () => {
return (
<View style={coverArtStyles.container}>
<CoverArt type="cover" coverArt={track?.coverArt} style={coverArtStyles.image} />
<CoverArt type="cover" size="original" coverArt={track?.coverArt} style={coverArtStyles.image} />
</View>
)
}

View File

@@ -4,7 +4,8 @@ import ImageGradientScrollView from '@app/components/ImageGradientScrollView'
import ListItem from '@app/components/ListItem'
import ListPlayerControls from '@app/components/ListPlayerControls'
import NothingHere from '@app/components/NothingHere'
import { useAlbumWithSongs, useCoverArtFile, usePlaylistWithSongs } from '@app/hooks/music'
import { useCoverArtFile } from '@app/hooks/cache'
import { useAlbumWithSongs, usePlaylistWithSongs } from '@app/hooks/music'
import { AlbumWithSongs, PlaylistWithSongs, Song } from '@app/models/music'
import { useStore } from '@app/state/store'
import { selectTrackPlayer } from '@app/state/trackplayer'
@@ -74,7 +75,7 @@ const SongListDetails = React.memo<{
songList?: AlbumWithSongs | PlaylistWithSongs
subtitle?: string
}>(({ songList, subtitle, type }) => {
const coverArtFile = useCoverArtFile(songList?.coverArt)
const coverArtFile = useCoverArtFile(songList?.coverArt, 'thumbnail')
if (!songList) {
return <SongListDetailsFallback />
@@ -83,7 +84,7 @@ const SongListDetails = React.memo<{
return (
<ImageGradientScrollView imagePath={coverArtFile?.file?.path} style={styles.container}>
<View style={styles.content}>
<CoverArt type="cover" coverArt={songList.coverArt} style={styles.cover} />
<CoverArt type="cover" size="original" coverArt={songList.coverArt} style={styles.cover} />
<Text style={styles.title}>{songList.name}</Text>
{subtitle ? <Text style={styles.subtitle}>{subtitle}</Text> : <></>}
{songList.songs.length > 0 ? (