add bitDepth, sampleRate columns to table (#1205)

This commit is contained in:
jeffvli
2025-12-07 19:41:03 -08:00
parent bd8503b25d
commit 4f4300042b
6 changed files with 67 additions and 1 deletions
@@ -46,6 +46,7 @@ const getRowIdFromTableColumn = (tableColumn: TableColumn): null | string => {
[TableColumn.ALBUM_COUNT]: 'albumCount',
[TableColumn.ARTIST]: 'artists',
[TableColumn.BIOGRAPHY]: null,
[TableColumn.BIT_DEPTH]: 'bitDepth',
[TableColumn.BIT_RATE]: null,
[TableColumn.BPM]: null,
[TableColumn.CHANNELS]: null,
@@ -62,8 +63,10 @@ const getRowIdFromTableColumn = (tableColumn: TableColumn): null | string => {
[TableColumn.OWNER]: null,
[TableColumn.PATH]: null,
[TableColumn.PLAY_COUNT]: 'playCount',
[TableColumn.PLAYLIST_REORDER]: null,
[TableColumn.RELEASE_DATE]: 'releaseDate',
[TableColumn.ROW_INDEX]: null,
[TableColumn.SAMPLE_RATE]: 'sampleRate',
[TableColumn.SIZE]: null,
[TableColumn.SKIP]: null,
[TableColumn.SONG_COUNT]: 'songCount',
@@ -139,6 +139,15 @@ export const SONG_TABLE_COLUMNS: DefaultTableColumn[] = [
value: TableColumn.TRACK_NUMBER,
width: 100,
},
{
align: 'center',
autoSize: false,
isEnabled: false,
label: i18n.t('table.config.label.bitDepth', { postProcess: 'titleCase' }),
pinned: null,
value: TableColumn.BIT_DEPTH,
width: 100,
},
{
align: 'center',
autoSize: false,
@@ -157,6 +166,15 @@ export const SONG_TABLE_COLUMNS: DefaultTableColumn[] = [
value: TableColumn.CODEC,
width: 100,
},
{
align: 'center',
autoSize: false,
isEnabled: false,
label: i18n.t('table.config.label.sampleRate', { postProcess: 'titleCase' }),
pinned: null,
value: TableColumn.SAMPLE_RATE,
width: 100,
},
{
align: 'center',
autoSize: false,
@@ -479,10 +479,12 @@ export const ItemTableListColumn = (props: ItemTableListColumn) => {
case TableColumn.COMMENT:
return <TextColumn {...props} {...dragProps} controls={controls} type={type} />;
case TableColumn.BIT_DEPTH:
case TableColumn.BIT_RATE:
case TableColumn.BPM:
case TableColumn.CHANNELS:
case TableColumn.DISC_NUMBER:
case TableColumn.SAMPLE_RATE:
case TableColumn.TRACK_NUMBER:
case TableColumn.YEAR:
return <NumericColumn {...props} {...dragProps} controls={controls} type={type} />;
@@ -1228,6 +1230,9 @@ const columnLabelMap: Record<TableColumn, ReactNode | string> = {
[TableColumn.BIOGRAPHY]: i18n.t('table.column.biography', {
postProcess: 'upperCase',
}) as string,
[TableColumn.BIT_DEPTH]: i18n.t('table.column.bitDepth', {
postProcess: 'upperCase',
}) as string,
[TableColumn.BIT_RATE]: i18n.t('table.column.bitrate', { postProcess: 'upperCase' }) as string,
[TableColumn.BPM]: i18n.t('table.column.bpm', { postProcess: 'upperCase' }) as string,
[TableColumn.CHANNELS]: i18n.t('table.column.channels', { postProcess: 'upperCase' }) as string,
@@ -1273,6 +1278,9 @@ const columnLabelMap: Record<TableColumn, ReactNode | string> = {
<Icon icon="hash" />
</Flex>
),
[TableColumn.SAMPLE_RATE]: i18n.t('table.column.sampleRate', {
postProcess: 'upperCase',
}) as string,
[TableColumn.SIZE]: i18n.t('table.column.size', { postProcess: 'upperCase' }) as string,
[TableColumn.SKIP]: '',
[TableColumn.SONG_COUNT]: i18n.t('table.column.songCount', {