mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
add bitDepth, sampleRate columns to table (#1205)
This commit is contained in:
@@ -938,6 +938,7 @@
|
||||
"albumCount": "$t(entity.album_other)",
|
||||
"artist": "$t(entity.artist_one)",
|
||||
"biography": "biography",
|
||||
"bitDepth": "$t(common.bitDepth)",
|
||||
"bitrate": "bitrate",
|
||||
"bpm": "bpm",
|
||||
"channels": "$t(common.channel_other)",
|
||||
@@ -953,6 +954,7 @@
|
||||
"rating": "rating",
|
||||
"releaseDate": "release date",
|
||||
"releaseYear": "year",
|
||||
"sampleRate": "$t(common.sampleRate)",
|
||||
"size": "$t(common.size)",
|
||||
"songCount": "$t(entity.track_other)",
|
||||
"title": "title",
|
||||
@@ -998,6 +1000,7 @@
|
||||
"albumArtist": "$t(entity.albumArtist_one)",
|
||||
"artist": "$t(entity.artist_one)",
|
||||
"biography": "$t(common.biography)",
|
||||
"bitDepth": "$t(common.bitDepth)",
|
||||
"bitrate": "$t(common.bitrate)",
|
||||
"bpm": "$t(common.bpm)",
|
||||
"channels": "$t(common.channel_other)",
|
||||
@@ -1017,6 +1020,7 @@
|
||||
"rating": "$t(common.rating)",
|
||||
"releaseDate": "release date",
|
||||
"rowIndex": "row index",
|
||||
"sampleRate": "$t(common.sampleRate)",
|
||||
"size": "$t(common.size)",
|
||||
"songCount": "$t(entity.track_other)",
|
||||
"title": "$t(common.title)",
|
||||
|
||||
@@ -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', {
|
||||
|
||||
@@ -1472,10 +1472,41 @@ export const useSettingsStore = createWithEqualityFn<SettingsSlice>()(
|
||||
});
|
||||
}
|
||||
|
||||
if (version <= 14) {
|
||||
// Add bitDepth and sampleRate columns to song lists
|
||||
|
||||
const bitDepthColumn: ItemTableListColumnConfig = {
|
||||
align: 'center',
|
||||
autoSize: false,
|
||||
id: TableColumn.BIT_DEPTH,
|
||||
isEnabled: false,
|
||||
pinned: null,
|
||||
width: 100,
|
||||
};
|
||||
|
||||
const sampleRateColumn: ItemTableListColumnConfig = {
|
||||
align: 'center',
|
||||
autoSize: false,
|
||||
id: TableColumn.SAMPLE_RATE,
|
||||
isEnabled: false,
|
||||
pinned: null,
|
||||
width: 100,
|
||||
};
|
||||
|
||||
const columns = [bitDepthColumn, sampleRateColumn];
|
||||
|
||||
state.lists[LibraryItem.SONG]?.table.columns.push(...columns);
|
||||
state.lists[LibraryItem.PLAYLIST_SONG]?.table.columns.push(...columns);
|
||||
state.lists[LibraryItem.QUEUE_SONG]?.table.columns.push(...columns);
|
||||
state.lists['albumDetail']?.table.columns.push(...columns);
|
||||
state.lists['fullscreen']?.table.columns.push(...columns);
|
||||
state.lists['sidequeue']?.table.columns.push(...columns);
|
||||
}
|
||||
|
||||
return persistedState;
|
||||
},
|
||||
name: 'store_settings',
|
||||
version: 14,
|
||||
version: 15,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -161,6 +161,7 @@ export enum TableColumn {
|
||||
ALBUM_COUNT = 'albumCount',
|
||||
ARTIST = 'artists',
|
||||
BIOGRAPHY = 'biography',
|
||||
BIT_DEPTH = 'bitDepth',
|
||||
BIT_RATE = 'bitRate',
|
||||
BPM = 'bpm',
|
||||
CHANNELS = 'channels',
|
||||
@@ -180,6 +181,7 @@ export enum TableColumn {
|
||||
PLAYLIST_REORDER = 'playlistReorder',
|
||||
RELEASE_DATE = 'releaseDate',
|
||||
ROW_INDEX = 'rowIndex',
|
||||
SAMPLE_RATE = 'sampleRate',
|
||||
SIZE = 'size',
|
||||
SKIP = 'skip',
|
||||
SONG_COUNT = 'songCount',
|
||||
|
||||
Reference in New Issue
Block a user