Add card/table types for album artists
This commit is contained in:
parent
6fddea552d
commit
4745c4a42d
3 changed files with 58 additions and 0 deletions
|
@ -178,3 +178,34 @@ export const ALBUM_CARD_ROWS: { [key: string]: CardRow<Album> } = {
|
||||||
property: 'songCount',
|
property: 'songCount',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const ALBUMARTIST_CARD_ROWS: { [key: string]: CardRow<AlbumArtist> } = {
|
||||||
|
albumCount: {
|
||||||
|
property: 'albumCount',
|
||||||
|
},
|
||||||
|
duration: {
|
||||||
|
property: 'duration',
|
||||||
|
},
|
||||||
|
genres: {
|
||||||
|
property: 'genres',
|
||||||
|
},
|
||||||
|
lastPlayedAt: {
|
||||||
|
property: 'lastPlayedAt',
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
property: 'name',
|
||||||
|
route: {
|
||||||
|
route: AppRoute.LIBRARY_ALBUMARTISTS_DETAIL,
|
||||||
|
slugs: [{ idProperty: 'id', slugProperty: 'albumArtistId' }],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
playCount: {
|
||||||
|
property: 'playCount',
|
||||||
|
},
|
||||||
|
rating: {
|
||||||
|
property: 'rating',
|
||||||
|
},
|
||||||
|
songCount: {
|
||||||
|
property: 'songCount',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
|
@ -57,12 +57,28 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
valueGetter: (params: ValueGetterParams) =>
|
valueGetter: (params: ValueGetterParams) =>
|
||||||
params.data ? params.data.albumArtists : undefined,
|
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: {
|
artist: {
|
||||||
cellRenderer: ArtistCell,
|
cellRenderer: ArtistCell,
|
||||||
colId: TableColumn.ARTIST,
|
colId: TableColumn.ARTIST,
|
||||||
headerName: 'Artist',
|
headerName: 'Artist',
|
||||||
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.artists : undefined),
|
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: {
|
bitRate: {
|
||||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'left' }),
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'left' }),
|
||||||
colId: TableColumn.BIT_RATE,
|
colId: TableColumn.BIT_RATE,
|
||||||
|
@ -175,6 +191,14 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
return (params.node?.rowIndex || 0) + 1;
|
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: {
|
title: {
|
||||||
cellRenderer: (params: ICellRendererParams) =>
|
cellRenderer: (params: ICellRendererParams) =>
|
||||||
GenericCell(params, { position: 'left', primary: true }),
|
GenericCell(params, { position: 'left', primary: true }),
|
||||||
|
|
|
@ -133,7 +133,9 @@ export type AdvancedFilterGroup = {
|
||||||
export enum TableColumn {
|
export enum TableColumn {
|
||||||
ALBUM = 'album',
|
ALBUM = 'album',
|
||||||
ALBUM_ARTIST = 'albumArtist',
|
ALBUM_ARTIST = 'albumArtist',
|
||||||
|
ALBUM_COUNT = 'albumCount',
|
||||||
ARTIST = 'artist',
|
ARTIST = 'artist',
|
||||||
|
BIOGRAPHY = 'biography',
|
||||||
BIT_RATE = 'bitRate',
|
BIT_RATE = 'bitRate',
|
||||||
BPM = 'bpm',
|
BPM = 'bpm',
|
||||||
CHANNELS = 'channels',
|
CHANNELS = 'channels',
|
||||||
|
@ -149,6 +151,7 @@ export enum TableColumn {
|
||||||
RATING = 'rating',
|
RATING = 'rating',
|
||||||
RELEASE_DATE = 'releaseDate',
|
RELEASE_DATE = 'releaseDate',
|
||||||
ROW_INDEX = 'rowIndex',
|
ROW_INDEX = 'rowIndex',
|
||||||
|
SONG_COUNT = 'songCount',
|
||||||
// SKIP = 'skip',
|
// SKIP = 'skip',
|
||||||
TITLE = 'title',
|
TITLE = 'title',
|
||||||
TITLE_COMBINED = 'titleCombined',
|
TITLE_COMBINED = 'titleCombined',
|
||||||
|
|
Reference in a new issue