improve image column play handler to support long press

This commit is contained in:
jeffvli
2025-12-03 16:25:28 -08:00
parent a7e6a75c68
commit 55ebc7d74a
10 changed files with 127 additions and 51 deletions
@@ -245,11 +245,7 @@ export const useDefaultItemListControls = (args?: UseDefaultItemListControlsArgs
return;
}
player.addToQueueByData(songsToAdd, Play.NOW);
const targetIndex = clickedIndex - startIndex;
player.mediaPlayByIndex(targetIndex);
player.addToQueueByData(songsToAdd, Play.NOW, item.id);
return;
}
@@ -35,7 +35,9 @@ export const ImageColumn = (props: ItemTableListInnerColumn) => {
// For SONG items, use double click behavior
if (
(props.itemType === LibraryItem.SONG || props.itemType === LibraryItem.PLAYLIST_SONG) &&
(props.itemType === LibraryItem.SONG ||
props.itemType === LibraryItem.PLAYLIST_SONG ||
item._itemType === LibraryItem.SONG) &&
props.controls?.onDoubleClick
) {
// Calculate the index based on rowIndex, accounting for header if enabled
@@ -48,6 +50,9 @@ export const ImageColumn = (props: ItemTableListInnerColumn) => {
internalState,
item,
itemType: props.itemType,
meta: {
playType,
},
});
return;
}