mirror of
https://github.com/LukeHagar/plex-api-oauth.git
synced 2025-12-06 04:20:40 +00:00
Corrected hasMore functionality
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plex-api-oauth",
|
"name": "plex-api-oauth",
|
||||||
"version": "1.1.98",
|
"version": "1.1.103",
|
||||||
"description": "An NPM Module designed to make Plex Media Server and plex.tv API calls easier to implement in JavaScript and React projects",
|
"description": "An NPM Module designed to make Plex Media Server and plex.tv API calls easier to implement in JavaScript and React projects",
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { PlexOauth } from "plex-oauth";
|
|||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import qs from "qs";
|
import qs from "qs";
|
||||||
// import InfiniteScroll from "react-infinite-scroller";
|
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
export async function PlexLogin(plexClientInformation) {
|
export async function PlexLogin(plexClientInformation) {
|
||||||
@@ -865,10 +864,13 @@ export async function GetLibraryPages(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
console.debug(data);
|
console.debug(data);
|
||||||
if (data !== null) {
|
try {
|
||||||
items = data;
|
items = data;
|
||||||
hasMore = data.length > 0;
|
hasMore = data.length === chunkSize;
|
||||||
console.debug({ items, hasMore });
|
console.debug({ items, hasMore });
|
||||||
|
} catch {
|
||||||
|
items = [];
|
||||||
|
hasMore = false;
|
||||||
}
|
}
|
||||||
return { items, hasMore };
|
return { items, hasMore };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user