Update playqueueadd props

This commit is contained in:
jeffvli 2023-05-20 14:55:08 -07:00
parent 7dd56bfb9b
commit 02caf896ff
24 changed files with 53 additions and 44 deletions

View file

@ -210,7 +210,7 @@ export const AlbumDetailContent = ({ tableRef }: AlbumDetailContentProps) => {
const handlePlay = async (playType?: Play) => {
handlePlayQueueAdd?.({
byData: detailQuery?.data?.songs,
play: playType || playButtonBehavior,
playType: playType || playButtonBehavior,
});
};
@ -218,9 +218,16 @@ export const AlbumDetailContent = ({ tableRef }: AlbumDetailContentProps) => {
const handleRowDoubleClick = (e: RowDoubleClickedEvent<QueueSong>) => {
if (!e.data) return;
const rowData: QueueSong[] = [];
e.api.forEachNode((node) => {
if (!node.data) return;
rowData.push(node.data);
});
handlePlayQueueAdd?.({
byData: [e.data],
play: playButtonBehavior,
byData: rowData,
playType: playButtonBehavior,
});
};

View file

@ -294,7 +294,7 @@ export const AlbumListHeaderFilters = ({
const handlePlayQueueAdd = usePlayQueueAdd();
const handlePlay = async (play: Play) => {
const handlePlay = async (playType: Play) => {
if (!itemCount || itemCount === 0 || !server) return;
const query = {
@ -327,7 +327,7 @@ export const AlbumListHeaderFilters = ({
id: albumIds,
type: LibraryItem.ALBUM,
},
play,
playType,
});
};

View file

@ -165,7 +165,7 @@ export const AlbumListHeader = ({
const handlePlayQueueAdd = usePlayQueueAdd();
const playButtonBehavior = usePlayButtonBehavior();
const handlePlay = async (play: Play) => {
const handlePlay = async (playType: Play) => {
if (!itemCount || itemCount === 0) return;
const query = {
@ -198,7 +198,7 @@ export const AlbumListHeader = ({
id: albumIds,
type: LibraryItem.ALBUM,
},
play,
playType,
});
};