|
@ -247,9 +247,15 @@ const ListViewTable = ({ |
|
|
|
|
|
|
|
|
if (sortColumn && sortType) { |
|
|
if (sortColumn && sortType) { |
|
|
// Since the column title(id) won't always match the actual column dataKey, we need to match it
|
|
|
// Since the column title(id) won't always match the actual column dataKey, we need to match it
|
|
|
const normalizedSortColumn = columns.find((c: any) => c.id === sortColumn); |
|
|
const actualSortColumn = columns.find((c: any) => c.id === sortColumn); |
|
|
const sortColumnDataKey = |
|
|
const sortColumnDataKey = |
|
|
normalizedSortColumn.dataKey === 'combinedtitle' ? 'title' : normalizedSortColumn.dataKey; |
|
|
actualSortColumn.dataKey === 'combinedtitle' |
|
|
|
|
|
? 'title' |
|
|
|
|
|
: actualSortColumn.dataKey === 'artist' |
|
|
|
|
|
? 'albumArtist' |
|
|
|
|
|
: actualSortColumn.dataKey === 'genre' |
|
|
|
|
|
? 'albumGenre' |
|
|
|
|
|
: actualSortColumn.dataKey; |
|
|
|
|
|
|
|
|
const sortData = _.orderBy( |
|
|
const sortData = _.orderBy( |
|
|
data, |
|
|
data, |
|
@ -274,7 +280,13 @@ const ListViewTable = ({ |
|
|
if (playQueue.sortColumn && playQueue.sortType) { |
|
|
if (playQueue.sortColumn && playQueue.sortType) { |
|
|
const actualSortColumn = columns.find((c: any) => c.id === playQueue.sortColumn); |
|
|
const actualSortColumn = columns.find((c: any) => c.id === playQueue.sortColumn); |
|
|
const sortColumnDataKey = |
|
|
const sortColumnDataKey = |
|
|
actualSortColumn.dataKey === 'combinedtitle' ? 'title' : actualSortColumn.dataKey; |
|
|
actualSortColumn.dataKey === 'combinedtitle' |
|
|
|
|
|
? 'title' |
|
|
|
|
|
: actualSortColumn.dataKey === 'artist' |
|
|
|
|
|
? 'albumArtist' |
|
|
|
|
|
: actualSortColumn.dataKey === 'genre' |
|
|
|
|
|
? 'albumGenre' |
|
|
|
|
|
: actualSortColumn.dataKey; |
|
|
|
|
|
|
|
|
dispatch( |
|
|
dispatch( |
|
|
sortPlayQueue({ |
|
|
sortPlayQueue({ |
|
@ -298,7 +310,13 @@ const ListViewTable = ({ |
|
|
if (sortColumn && sortType) { |
|
|
if (sortColumn && sortType) { |
|
|
const actualSortColumn = columns.find((c: any) => c.id === sortColumn); |
|
|
const actualSortColumn = columns.find((c: any) => c.id === sortColumn); |
|
|
const sortColumnDataKey = |
|
|
const sortColumnDataKey = |
|
|
actualSortColumn.dataKey === 'combinedtitle' ? 'title' : actualSortColumn.dataKey; |
|
|
actualSortColumn.dataKey === 'combinedtitle' |
|
|
|
|
|
? 'title' |
|
|
|
|
|
: actualSortColumn.dataKey === 'artist' |
|
|
|
|
|
? 'albumArtist' |
|
|
|
|
|
: actualSortColumn.dataKey === 'genre' |
|
|
|
|
|
? 'albumGenre' |
|
|
|
|
|
: actualSortColumn.dataKey; |
|
|
|
|
|
|
|
|
dispatch( |
|
|
dispatch( |
|
|
sortPlaylist({ |
|
|
sortPlaylist({ |
|
@ -726,19 +744,19 @@ const ListViewTable = ({ |
|
|
width: '100%', |
|
|
width: '100%', |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<CustomTooltip text={rowData.artist}> |
|
|
<CustomTooltip text={rowData.albumArtist}> |
|
|
<RsuiteLinkButton |
|
|
<RsuiteLinkButton |
|
|
subtitle="true" |
|
|
subtitle="true" |
|
|
appearance="link" |
|
|
appearance="link" |
|
|
onClick={(e: any) => { |
|
|
onClick={(e: any) => { |
|
|
if (!e.ctrlKey && !e.shiftKey) { |
|
|
if (!e.ctrlKey && !e.shiftKey) { |
|
|
if (rowData.artistId && !isModal) { |
|
|
if (rowData.albumArtistId && !isModal) { |
|
|
history.push(`/library/artist/${rowData.artistId}`); |
|
|
history.push(`/library/artist/${rowData.albumArtistId}`); |
|
|
} else if (rowData.artistId && isModal) { |
|
|
} else if (rowData.albumArtistId && isModal) { |
|
|
dispatch( |
|
|
dispatch( |
|
|
addModalPage({ |
|
|
addModalPage({ |
|
|
pageType: 'artist', |
|
|
pageType: 'artist', |
|
|
id: rowData.artistId, |
|
|
id: rowData.albumArtistId, |
|
|
}) |
|
|
}) |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
@ -757,7 +775,7 @@ const ListViewTable = ({ |
|
|
: 'false' |
|
|
: 'false' |
|
|
} |
|
|
} |
|
|
> |
|
|
> |
|
|
{rowData.artist} |
|
|
{rowData.albumArtist} |
|
|
</RsuiteLinkButton> |
|
|
</RsuiteLinkButton> |
|
|
</CustomTooltip> |
|
|
</CustomTooltip> |
|
|
</span> |
|
|
</span> |
|
@ -881,38 +899,40 @@ const ListViewTable = ({ |
|
|
: undefined, |
|
|
: undefined, |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
{column.dataKey.match(/album|artist|genre/) ? ( |
|
|
{column.dataKey.match(/artist|genre/) ? ( |
|
|
<CustomTooltip text={rowData[column.dataKey]}> |
|
|
<> |
|
|
|
|
|
{rowData[column.dataKey] && ( |
|
|
|
|
|
<CustomTooltip text={rowData[column.dataKey][0]?.title}> |
|
|
<RsuiteLinkButton |
|
|
<RsuiteLinkButton |
|
|
appearance="link" |
|
|
appearance="link" |
|
|
onClick={(e: any) => { |
|
|
onClick={(e: any) => { |
|
|
if (!e.ctrlKey && !e.shiftKey) { |
|
|
if (!e.ctrlKey && !e.shiftKey) { |
|
|
if (column.dataKey === 'album') { |
|
|
if (column.dataKey === 'artist') { |
|
|
if (rowData.albumId && !isModal) { |
|
|
if (rowData[column.dataKey][0]?.id && !isModal) { |
|
|
history.push(`/library/album/${rowData.albumId}`); |
|
|
history.push( |
|
|
} else if (rowData.albumId && isModal) { |
|
|
`/library/artist/${rowData[column.dataKey][0]?.id}` |
|
|
dispatch( |
|
|
|
|
|
addModalPage({ |
|
|
|
|
|
pageType: 'album', |
|
|
|
|
|
id: rowData.albumId, |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
); |
|
|
} |
|
|
} else if (rowData[0]?.id && isModal) { |
|
|
} else if (column.dataKey === 'artist') { |
|
|
|
|
|
if (rowData.artistId && !isModal) { |
|
|
|
|
|
history.push(`/library/artist/${rowData.artistId}`); |
|
|
|
|
|
} else if (rowData.artistId && isModal) { |
|
|
|
|
|
dispatch( |
|
|
dispatch( |
|
|
addModalPage({ |
|
|
addModalPage({ |
|
|
pageType: 'artist', |
|
|
pageType: 'artist', |
|
|
id: rowData.artistId, |
|
|
id: rowData[0]?.id, |
|
|
}) |
|
|
}) |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
} else if (column.dataKey === 'genre') { |
|
|
} else if (column.dataKey === 'genre') { |
|
|
dispatch(setActive({ ...album.active, filter: rowData.genre })); |
|
|
dispatch( |
|
|
|
|
|
setActive({ |
|
|
|
|
|
...album.active, |
|
|
|
|
|
filter: rowData[column.dataKey][0]?.id, |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
history.push(`/library/album?sortType=${rowData.genre}`); |
|
|
history.push( |
|
|
|
|
|
`/library/album?sortType=${ |
|
|
|
|
|
rowData[column.dataKey][0]?.id |
|
|
|
|
|
}` |
|
|
|
|
|
); |
|
|
}, 50); |
|
|
}, 50); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -929,6 +949,42 @@ const ListViewTable = ({ |
|
|
style={{ |
|
|
style={{ |
|
|
fontSize: `${fontSize}px`, |
|
|
fontSize: `${fontSize}px`, |
|
|
}} |
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
{rowData[column.dataKey][0]?.title} |
|
|
|
|
|
</RsuiteLinkButton> |
|
|
|
|
|
</CustomTooltip> |
|
|
|
|
|
)} |
|
|
|
|
|
</> |
|
|
|
|
|
) : column.dataKey === 'album' ? ( |
|
|
|
|
|
<CustomTooltip text={rowData[column.dataKey]}> |
|
|
|
|
|
<RsuiteLinkButton |
|
|
|
|
|
appearance="link" |
|
|
|
|
|
onClick={(e: any) => { |
|
|
|
|
|
if (!e.ctrlKey && !e.shiftKey) { |
|
|
|
|
|
if (rowData.albumId && !isModal) { |
|
|
|
|
|
history.push(`/library/album/${rowData.albumId}`); |
|
|
|
|
|
} else if (rowData.albumId && isModal) { |
|
|
|
|
|
dispatch( |
|
|
|
|
|
addModalPage({ |
|
|
|
|
|
pageType: 'album', |
|
|
|
|
|
id: rowData.albumId, |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}} |
|
|
|
|
|
playing={ |
|
|
|
|
|
(rowData.uniqueId === playQueue?.currentSongUniqueId && |
|
|
|
|
|
nowPlaying) || |
|
|
|
|
|
(!nowPlaying && |
|
|
|
|
|
rowData.id === playQueue?.currentSongId && |
|
|
|
|
|
playQueue?.currentSongId) |
|
|
|
|
|
? 'true' |
|
|
|
|
|
: 'false' |
|
|
|
|
|
} |
|
|
|
|
|
style={{ |
|
|
|
|
|
fontSize: `${fontSize}px`, |
|
|
|
|
|
}} |
|
|
> |
|
|
> |
|
|
{rowData[column.dataKey]} |
|
|
{rowData[column.dataKey]} |
|
|
</RsuiteLinkButton> |
|
|
</RsuiteLinkButton> |
|
|