use only original/large imges for covers/artist

fix view artist from context menu
add loading indicators to song list and artist views (show info we have right away)
This commit is contained in:
austinried
2022-03-20 15:27:27 +09:00
parent a15159014c
commit c9aea9065c
8 changed files with 78 additions and 74 deletions

View File

@@ -37,7 +37,7 @@ function BackgroundHeaderFlatList<ItemT>(props: BackgroundHeaderFlatListProp<Ite
</props.BackgroundComponent>
}
ListHeaderComponentStyle={[headerStyle]}
ListEmptyComponent={<NothingHere style={styles.nothing} />}
ListEmptyComponent={props.ListEmptyComponent || <NothingHere style={styles.nothing} />}
/>
)
}

View File

@@ -1,5 +1,5 @@
import { useArtistArtFile, useCoverArtFile } from '@app/hooks/cache'
import { CacheFile, CacheImageSize, CacheRequest } from '@app/models/cache'
import { CacheFile, CacheRequest } from '@app/models/cache'
import colors from '@app/styles/colors'
import React, { useState } from 'react'
import {
@@ -18,7 +18,6 @@ type BaseProps = {
imageStyle?: ImageStyle
resizeMode?: ImageResizeMode
round?: boolean
size?: CacheImageSize
}
type ArtistCoverArtProps = BaseProps & {
@@ -63,13 +62,13 @@ const ImageSource = React.memo<{ cache?: { file?: CacheFile; request?: CacheRequ
)
const ArtistImage = React.memo<ArtistCoverArtProps>(props => {
const cache = useArtistArtFile(props.artistId, props.size)
const cache = useArtistArtFile(props.artistId)
return <ImageSource cache={cache} {...props} imageStyle={{ ...styles.artistImage, ...props.imageStyle }} />
})
const CoverArtImage = React.memo<CoverArtProps>(props => {
const cache = useCoverArtFile(props.coverArt, props.size)
const cache = useCoverArtFile(props.coverArt)
return <ImageSource cache={cache} {...props} />
})

View File

@@ -36,11 +36,14 @@ const ListPlayerControls = React.memo<{
<View style={styles.controlsCenter}>
<Button
title={`Play ${typeName}`}
disabled={songs.length === 0}
onPress={() => setQueue(songs, queueName, queueContextType, queueContextId, undefined, false)}
/>
</View>
<View style={styles.controlsSide}>
<Button onPress={() => setQueue(songs, queueName, queueContextType, queueContextId, undefined, true)}>
<Button
disabled={songs.length === 0}
onPress={() => setQueue(songs, queueName, queueContextType, queueContextId, undefined, true)}>
<Icon name="shuffle" size={26} color="white" />
</Button>
</View>