mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 11:36:36 +08:00
优化
This commit is contained in:
@@ -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 (;;) {
|
||||
|
||||
Reference in New Issue
Block a user