ENH - paginate Gallery in batches of 30

This commit is contained in:
Eichenholz
2026-08-06 16:57:29 +02:00
parent 4a3e526879
commit 8ce0e65ccd
5 changed files with 35 additions and 20 deletions
+7
View File
@@ -3,6 +3,7 @@ import { describe, expect, it } from 'vitest'
import {
filterMedia,
formatRecordingDuration,
hasNextMediaPage,
mediaErrorKey,
mergeMedia,
} from './media'
@@ -32,6 +33,12 @@ describe('media utilities', () => {
])
})
it('loads another gallery page only after a full 30-item batch', () => {
expect(hasNextMediaPage(30)).toBe(true)
expect(hasNextMediaPage(29)).toBe(false)
expect(hasNextMediaPage(0)).toBe(false)
})
it('formats unlimited recording durations', () => {
expect(formatRecordingDuration(0)).toBe('00:00')
expect(formatRecordingDuration(3_725_000)).toBe('62:05')