This commit is contained in:
truewhile
2026-09-01 16:26:25 +08:00
parent 73de139d1f
commit af67f4cd6e
23 changed files with 671 additions and 131 deletions
+6 -4
View File
@@ -58,7 +58,7 @@ export function useLibraryData(libraryID: string, selectedSeries: SeriesCard | n
const loadAll = async () => {
if (isSeriesLibrary) {
const collected = await loadAllSeriesCards(libraryID, (next) => {
const collected = await loadAllSeriesCards(libraryID, library.is_remote_emby, (next) => {
if (cancelled) return
setTotal(next.total)
if (next.firstPage) {
@@ -70,7 +70,7 @@ export function useLibraryData(libraryID: string, selectedSeries: SeriesCard | n
return
}
const collected = await loadAllMedia(libraryID, (next) => {
const collected = await loadAllMedia(libraryID, library.is_remote_emby, (next) => {
if (cancelled) return
setTotal(next.total)
if (next.firstPage) {
@@ -147,9 +147,10 @@ function isSeriesLibraryType(type?: string) {
async function loadAllSeriesCards(
libraryID: string,
isRemoteEmby: boolean | undefined,
onPage: (state: { items: SeriesCard[]; total: number; firstPage: boolean }) => void,
) {
const pageSize = 500
const pageSize = isRemoteEmby ? 100 : 500
let page = 1
let collected: SeriesCard[] = []
for (;;) {
@@ -166,9 +167,10 @@ async function loadAllSeriesCards(
async function loadAllMedia(
libraryID: string,
isRemoteEmby: boolean | undefined,
onPage: (state: { items: Media[]; total: number; firstPage: boolean }) => void,
) {
const pageSize = 2000
const pageSize = isRemoteEmby ? 100 : 2000
let page = 1
let collected: Media[] = []
for (;;) {