ignore external albums in album section playback handler

This commit is contained in:
jeffvli
2026-01-08 01:30:32 -08:00
parent 82914c27f0
commit 3550177f67
@@ -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