|
|
@ -34,9 +34,20 @@ import GenericPageHeader from '../layout/GenericPageHeader'; |
|
|
|
import { setStatus } from '../../redux/playerSlice'; |
|
|
|
import { addModalPage } from '../../redux/miscSlice'; |
|
|
|
import { notifyToast } from '../shared/toast'; |
|
|
|
import { filterPlayQueue, getPlayedSongsNotification, isCached } from '../../shared/utils'; |
|
|
|
import { StyledLink } from '../shared/styled'; |
|
|
|
import { |
|
|
|
filterPlayQueue, |
|
|
|
formatDate, |
|
|
|
formatDuration, |
|
|
|
getPlayedSongsNotification, |
|
|
|
isCached, |
|
|
|
} from '../../shared/utils'; |
|
|
|
import { StyledTagLink } from '../shared/styled'; |
|
|
|
import { setActive } from '../../redux/albumSlice'; |
|
|
|
import { |
|
|
|
BlurredBackground, |
|
|
|
BlurredBackgroundWrapper, |
|
|
|
PageHeaderSubtitleDataLine, |
|
|
|
} from '../layout/styled'; |
|
|
|
|
|
|
|
interface AlbumParams { |
|
|
|
id: string; |
|
|
@ -171,10 +182,24 @@ const AlbumView = ({ ...rest }: any) => { |
|
|
|
} |
|
|
|
|
|
|
|
return ( |
|
|
|
<> |
|
|
|
{!rest.isModal && ( |
|
|
|
<BlurredBackgroundWrapper |
|
|
|
image={!data?.image.match('placeholder') ? data.image : null} |
|
|
|
expanded={misc.expandSidebar} |
|
|
|
> |
|
|
|
<BlurredBackground |
|
|
|
image={!data?.image.match('placeholder') ? data.image : null} |
|
|
|
expanded={misc.expandSidebar} |
|
|
|
/> |
|
|
|
</BlurredBackgroundWrapper> |
|
|
|
)} |
|
|
|
|
|
|
|
<GenericPage |
|
|
|
hideDivider |
|
|
|
header={ |
|
|
|
<GenericPageHeader |
|
|
|
isDark={!rest.isModal} |
|
|
|
image={ |
|
|
|
isCached(`${misc.imageCachePath}album_${albumId}.jpg`) |
|
|
|
? `${misc.imageCachePath}album_${albumId}.jpg` |
|
|
@ -185,20 +210,29 @@ const AlbumView = ({ ...rest }: any) => { |
|
|
|
cacheType: 'album', |
|
|
|
id: data.albumId, |
|
|
|
}} |
|
|
|
imageHeight={200} |
|
|
|
title={data.name} |
|
|
|
showTitleTooltip |
|
|
|
subtitle={ |
|
|
|
<div> |
|
|
|
<div |
|
|
|
style={{ |
|
|
|
overflow: 'hidden', |
|
|
|
textOverflow: 'ellipsis', |
|
|
|
whiteSpace: 'nowrap', |
|
|
|
}} |
|
|
|
> |
|
|
|
<PageHeaderSubtitleDataLine $top> |
|
|
|
<strong>ALBUM</strong> {' • '} {data.songCount} songs,{' '} |
|
|
|
{formatDuration(data.duration)} |
|
|
|
{data.year && ( |
|
|
|
<> |
|
|
|
{' • '} |
|
|
|
{data.year} |
|
|
|
</> |
|
|
|
)} |
|
|
|
</PageHeaderSubtitleDataLine> |
|
|
|
<PageHeaderSubtitleDataLine> |
|
|
|
Added {formatDate(data.created)} |
|
|
|
</PageHeaderSubtitleDataLine> |
|
|
|
<PageHeaderSubtitleDataLine> |
|
|
|
{data.artist && ( |
|
|
|
<StyledLink |
|
|
|
<StyledTagLink |
|
|
|
tabIndex={0} |
|
|
|
tooltip={data.artist} |
|
|
|
onClick={() => { |
|
|
|
if (!rest.isModal) { |
|
|
|
history.push(`/library/artist/${data.artistId}`); |
|
|
@ -228,13 +262,13 @@ const AlbumView = ({ ...rest }: any) => { |
|
|
|
}} |
|
|
|
> |
|
|
|
{data.artist} |
|
|
|
</StyledLink> |
|
|
|
</StyledTagLink> |
|
|
|
)} |
|
|
|
{data.genre && ( |
|
|
|
<> |
|
|
|
{' • '} |
|
|
|
<StyledLink |
|
|
|
<StyledTagLink |
|
|
|
tabIndex={0} |
|
|
|
tooltip={data.genre} |
|
|
|
onClick={() => { |
|
|
|
if (!rest.isModal) { |
|
|
|
dispatch(setActive({ ...album.active, filter: data.genre })); |
|
|
@ -270,31 +304,24 @@ const AlbumView = ({ ...rest }: any) => { |
|
|
|
}} |
|
|
|
> |
|
|
|
{data.genre} |
|
|
|
</StyledLink> |
|
|
|
</> |
|
|
|
)} |
|
|
|
|
|
|
|
{data.year && ( |
|
|
|
<> |
|
|
|
{' • '} |
|
|
|
{data.year} |
|
|
|
</StyledTagLink> |
|
|
|
</> |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</PageHeaderSubtitleDataLine> |
|
|
|
<div style={{ marginTop: '10px' }}> |
|
|
|
<ButtonToolbar> |
|
|
|
<PlayButton appearance="primary" size="md" onClick={handlePlay} /> |
|
|
|
<PlayButton appearance="primary" size="lg" onClick={handlePlay} /> |
|
|
|
<PlayAppendNextButton |
|
|
|
appearance="primary" |
|
|
|
size="md" |
|
|
|
size="lg" |
|
|
|
onClick={() => handlePlayAppend('next')} |
|
|
|
/> |
|
|
|
<PlayAppendButton |
|
|
|
appearance="primary" |
|
|
|
size="md" |
|
|
|
size="lg" |
|
|
|
onClick={() => handlePlayAppend('later')} |
|
|
|
/> |
|
|
|
<FavoriteButton size="md" isFavorite={data.starred} onClick={handleFavorite} /> |
|
|
|
<FavoriteButton size="lg" isFavorite={data.starred} onClick={handleFavorite} /> |
|
|
|
</ButtonToolbar> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -331,6 +358,7 @@ const AlbumView = ({ ...rest }: any) => { |
|
|
|
handleFavorite={handleRowFavorite} |
|
|
|
/> |
|
|
|
</GenericPage> |
|
|
|
</> |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|