mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
ignore external albums in album section playback handler
This commit is contained in:
@@ -1078,13 +1078,18 @@ const AlbumSection = ({ albums, controls, cq, releaseType, rows, title }: AlbumS
|
|||||||
const displayedAlbums = showAll ? albums : albums.slice(0, MAX_SECTION_CARDS);
|
const displayedAlbums = showAll ? albums : albums.slice(0, MAX_SECTION_CARDS);
|
||||||
const hasMoreAlbums = albums.length > MAX_SECTION_CARDS;
|
const hasMoreAlbums = albums.length > MAX_SECTION_CARDS;
|
||||||
|
|
||||||
|
const nonExternalAlbums = useMemo(
|
||||||
|
() => albums.filter((album) => album._serverType !== ServerType.EXTERNAL),
|
||||||
|
[albums],
|
||||||
|
);
|
||||||
|
|
||||||
const handlePlay = useCallback(
|
const handlePlay = useCallback(
|
||||||
(playType: Play) => {
|
(playType: Play) => {
|
||||||
if (albums.length === 0) return;
|
if (nonExternalAlbums.length === 0) return;
|
||||||
const albumIds = albums.map((album) => album.id);
|
const albumIds = nonExternalAlbums.map((album) => album.id);
|
||||||
player.addToQueueByFetch(serverId, albumIds, LibraryItem.ALBUM, playType);
|
player.addToQueueByFetch(serverId, albumIds, LibraryItem.ALBUM, playType);
|
||||||
},
|
},
|
||||||
[albums, player, serverId],
|
[nonExternalAlbums, player, serverId],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handlePlayNext = usePlayButtonClick({
|
const handlePlayNext = usePlayButtonClick({
|
||||||
@@ -1125,7 +1130,7 @@ const AlbumSection = ({ albums, controls, cq, releaseType, rows, title }: AlbumS
|
|||||||
</Group>
|
</Group>
|
||||||
<div className={styles.albumSectionDividerContainer}>
|
<div className={styles.albumSectionDividerContainer}>
|
||||||
<div className={styles.albumSectionDivider} />
|
<div className={styles.albumSectionDivider} />
|
||||||
{albumCount > 0 && (
|
{nonExternalAlbums.length > 0 && (
|
||||||
<ActionIconGroup>
|
<ActionIconGroup>
|
||||||
<PlayTooltip type={Play.NOW}>
|
<PlayTooltip type={Play.NOW}>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
|
|||||||
Reference in New Issue
Block a user