|
|
@ -309,6 +309,7 @@ const ListViewTable = ({ |
|
|
|
if (sortColumn && sortType) { |
|
|
|
// Since the column title(id) won't always match the actual column dataKey, we need to match it
|
|
|
|
const actualSortColumn = columns.find((c: any) => c.id === sortColumn); |
|
|
|
if (actualSortColumn) { |
|
|
|
const sortColumnDataKey = |
|
|
|
actualSortColumn.dataKey === 'combinedtitle' |
|
|
|
? 'title' |
|
|
@ -334,20 +335,22 @@ const ListViewTable = ({ |
|
|
|
setSortedData(data); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, [columns, configState.sort, data, nowPlaying, page, sortColumn, sortType]); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (nowPlaying) { |
|
|
|
if (playQueue.sortColumn && playQueue.sortType) { |
|
|
|
const actualSortColumn = columns.find((c: any) => c.id === playQueue.sortColumn); |
|
|
|
if (actualSortColumn) { |
|
|
|
const sortColumnDataKey = |
|
|
|
actualSortColumn.dataKey === 'combinedtitle' |
|
|
|
actualSortColumn?.dataKey === 'combinedtitle' |
|
|
|
? 'title' |
|
|
|
: actualSortColumn.dataKey === 'artist' |
|
|
|
: actualSortColumn?.dataKey === 'artist' |
|
|
|
? 'albumArtist' |
|
|
|
: actualSortColumn.dataKey === 'genre' |
|
|
|
: actualSortColumn?.dataKey === 'genre' |
|
|
|
? 'albumGenre' |
|
|
|
: actualSortColumn.dataKey; |
|
|
|
: actualSortColumn?.dataKey; |
|
|
|
|
|
|
|
dispatch( |
|
|
|
sortPlayQueue({ |
|
|
@ -367,6 +370,7 @@ const ListViewTable = ({ |
|
|
|
if (playQueue.currentPlayer === 1 && !playQueue.isFading) { |
|
|
|
dispatch(fixPlayer2Index()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (playlist) { |
|
|
|
if (sortColumn && sortType) { |
|
|
|
const actualSortColumn = columns.find((c: any) => c.id === sortColumn); |
|
|
@ -914,8 +918,22 @@ const ListViewTable = ({ |
|
|
|
misc={misc} |
|
|
|
rowHeight={rowHeight} |
|
|
|
cacheImages={cacheImages} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -952,8 +970,22 @@ const ListViewTable = ({ |
|
|
|
misc={misc} |
|
|
|
rowHeight={rowHeight} |
|
|
|
cacheImages={cacheImages} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -992,7 +1024,12 @@ const ListViewTable = ({ |
|
|
|
rowHeight={rowHeight} |
|
|
|
cacheImages={cacheImages} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -1014,8 +1051,22 @@ const ListViewTable = ({ |
|
|
|
rowIndex={rowIndex} |
|
|
|
column={column} |
|
|
|
rowHeight={rowHeight} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -1038,8 +1089,22 @@ const ListViewTable = ({ |
|
|
|
rowIndex={rowIndex} |
|
|
|
column={column} |
|
|
|
rowHeight={rowHeight} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -1062,8 +1127,22 @@ const ListViewTable = ({ |
|
|
|
rowIndex={rowIndex} |
|
|
|
column={column} |
|
|
|
rowHeight={rowHeight} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -1110,8 +1189,22 @@ const ListViewTable = ({ |
|
|
|
misc={misc} |
|
|
|
rowHeight={rowHeight} |
|
|
|
cacheImages={cacheImages} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -1133,8 +1226,22 @@ const ListViewTable = ({ |
|
|
|
rowIndex={rowIndex} |
|
|
|
column={column} |
|
|
|
rowHeight={rowHeight} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -1157,8 +1264,22 @@ const ListViewTable = ({ |
|
|
|
rowIndex={rowIndex} |
|
|
|
column={column} |
|
|
|
rowHeight={rowHeight} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -1192,8 +1313,22 @@ const ListViewTable = ({ |
|
|
|
rowIndex={rowIndex} |
|
|
|
column={column} |
|
|
|
rowHeight={rowHeight} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
@ -1221,8 +1356,22 @@ const ListViewTable = ({ |
|
|
|
rowIndex={rowIndex} |
|
|
|
column={column} |
|
|
|
rowHeight={rowHeight} |
|
|
|
handleRowClick={handleRowClick} |
|
|
|
handleRowDoubleClick={handleRowDoubleClick} |
|
|
|
handleRowClick={(e: any) => { |
|
|
|
handleRowClick( |
|
|
|
e, |
|
|
|
{ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}, |
|
|
|
sortColumn && !nowPlaying ? sortedData : data |
|
|
|
); |
|
|
|
}} |
|
|
|
handleRowDoubleClick={() => { |
|
|
|
handleRowDoubleClick({ |
|
|
|
...rowData, |
|
|
|
rowIndex, |
|
|
|
}); |
|
|
|
}} |
|
|
|
onMouseDown={(e: any) => { |
|
|
|
handleStartSelectDrag.onMouseDown(rowData); |
|
|
|
handleSelectMouseDown(e, rowData); |
|
|
|