mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-23 23:20:57 +03:00
feat(ui): Improve Artist Album pagination
- use maximum of albumartist/artist credits for determining pagination - reduce default maxPerPage considerably. This gives values of 36/72/108 at largest size
This commit is contained in:
parent
74348a340f
commit
4a69507e3e
@ -56,11 +56,16 @@ const AlbumShowLayout = (props) => {
|
||||
const { width } = props
|
||||
const [, perPageOptions] = useAlbumsPerPage(width)
|
||||
|
||||
const maxPerPage = 90
|
||||
const maxPerPage = 36
|
||||
let perPage = 0
|
||||
let pagination = null
|
||||
|
||||
if (record?.stats?.['artist']?.albumCount > maxPerPage) {
|
||||
const count = Math.max(
|
||||
record?.stats?.['albumartist']?.albumCount || 0,
|
||||
record?.stats?.['artist']?.albumCount ?? 0,
|
||||
)
|
||||
|
||||
if (count > maxPerPage) {
|
||||
perPage = Math.trunc(maxPerPage / perPageOptions[0]) * perPageOptions[0]
|
||||
const rowsPerPageOptions = [1, 2, 3].map((option) => option * perPage)
|
||||
pagination = <Pagination rowsPerPageOptions={rowsPerPageOptions} />
|
||||
|
Loading…
x
Reference in New Issue
Block a user