fix: register playCount column in backend AllColumnIDs + rename to 'Play Count'
Backend validation rejected 'playCount' as unknown column ID, silently preventing it from being enabled or persisted. Added ColPlayCount to the tracklist package's constant list and AllColumnIDs slice.
This commit is contained in:
@@ -33,6 +33,7 @@ const (
|
|||||||
ColChannels ColumnID = "channels"
|
ColChannels ColumnID = "channels"
|
||||||
ColBitrate ColumnID = "bitrate"
|
ColBitrate ColumnID = "bitrate"
|
||||||
ColFileSize ColumnID = "fileSize"
|
ColFileSize ColumnID = "fileSize"
|
||||||
|
ColPlayCount ColumnID = "playCount"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AllColumnIDs lists every recognised column in default display
|
// AllColumnIDs lists every recognised column in default display
|
||||||
@@ -54,6 +55,7 @@ var AllColumnIDs = []ColumnID{
|
|||||||
ColChannels,
|
ColChannels,
|
||||||
ColBitrate,
|
ColBitrate,
|
||||||
ColFileSize,
|
ColFileSize,
|
||||||
|
ColPlayCount,
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultColumns is the initial column configuration matching the
|
// DefaultColumns is the initial column configuration matching the
|
||||||
|
|||||||
@@ -188,10 +188,10 @@ export const COLUMN_DEFS: Record<string, ColumnDef> = {
|
|||||||
},
|
},
|
||||||
playCount: {
|
playCount: {
|
||||||
id: 'playCount',
|
id: 'playCount',
|
||||||
label: 'Plays',
|
label: 'Play Count',
|
||||||
accessor: (t) =>
|
accessor: (t) =>
|
||||||
t.PlayCount ? String(t.PlayCount) : '',
|
t.PlayCount ? String(t.PlayCount) : '',
|
||||||
defaultWidth: '60px',
|
defaultWidth: '80px',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
comparator: (a, b) =>
|
comparator: (a, b) =>
|
||||||
compareNum(a.PlayCount, b.PlayCount),
|
compareNum(a.PlayCount, b.PlayCount),
|
||||||
|
|||||||
Reference in New Issue
Block a user