Add card/table types for album artists

This commit is contained in:
jeffvli 2022-12-30 21:11:09 -08:00
parent 6fddea552d
commit 4745c4a42d
3 changed files with 58 additions and 0 deletions

View file

@ -57,12 +57,28 @@ const tableColumns: { [key: string]: ColDef } = {
valueGetter: (params: ValueGetterParams) =>
params.data ? params.data.albumArtists : undefined,
},
albumCount: {
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'center' }),
colId: TableColumn.ALBUM_COUNT,
field: 'albumCount',
headerComponent: (params: IHeaderParams) => GenericTableHeader(params, { position: 'center' }),
headerName: 'Albums',
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.albumCount : undefined),
},
artist: {
cellRenderer: ArtistCell,
colId: TableColumn.ARTIST,
headerName: 'Artist',
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.artists : undefined),
},
biography: {
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'left' }),
colId: TableColumn.BIOGRAPHY,
field: 'biography',
headerComponent: (params: IHeaderParams) => GenericTableHeader(params, { position: 'left' }),
headerName: 'Biography',
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.biography : undefined),
},
bitRate: {
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'left' }),
colId: TableColumn.BIT_RATE,
@ -175,6 +191,14 @@ const tableColumns: { [key: string]: ColDef } = {
return (params.node?.rowIndex || 0) + 1;
},
},
songCount: {
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'center' }),
colId: TableColumn.SONG_COUNT,
field: 'songCount',
headerComponent: (params: IHeaderParams) => GenericTableHeader(params, { position: 'center' }),
headerName: 'Songs',
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.songCount : undefined),
},
title: {
cellRenderer: (params: ICellRendererParams) =>
GenericCell(params, { position: 'left', primary: true }),