Faster display of cover in album detail view

This commit is contained in:
Deluan 2020-11-07 22:45:04 -05:00
parent 02160465a5
commit 8d608ac5b2
1 changed files with 11 additions and 2 deletions

View File

@ -22,7 +22,16 @@ const AlbumDetails = ({ classes, record }) => {
return genreDateLine.join(' · ')
}
const imageUrl = subsonic.url('getCoverArt', record.coverArtId || 'not_found')
const imageUrl = subsonic.url(
'getCoverArt',
record.coverArtId || 'not_found',
{ size: 300 }
)
const fullImageUrl = subsonic.url(
'getCoverArt',
record.coverArtId || 'not_found'
)
const handleOpenLightbox = React.useCallback(() => setLightboxOpen(true), [])
const handleCloseLightbox = React.useCallback(
@ -59,7 +68,7 @@ const AlbumDetails = ({ classes, record }) => {
imagePadding={50}
animationDuration={200}
imageTitle={record.name}
mainSrc={imageUrl}
mainSrc={fullImageUrl}
onCloseRequest={handleCloseLightbox}
/>
)}