diff --git a/package.json b/package.json index 2971572..2bd68e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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", "main": "./src/index.js", "type": "module", diff --git a/src/PlexAPIOAuth/PlexAPIOAuth.js b/src/PlexAPIOAuth/PlexAPIOAuth.js index 4f75bf1..741b6a5 100644 --- a/src/PlexAPIOAuth/PlexAPIOAuth.js +++ b/src/PlexAPIOAuth/PlexAPIOAuth.js @@ -2,7 +2,6 @@ import { PlexOauth } from "plex-oauth"; import { v4 } from "uuid"; import axios from "axios"; import qs from "qs"; -// import InfiniteScroll from "react-infinite-scroller"; import { useState, useEffect } from "react"; export async function PlexLogin(plexClientInformation) { @@ -865,10 +864,13 @@ export async function GetLibraryPages( break; } console.debug(data); - if (data !== null) { + try { items = data; - hasMore = data.length > 0; + hasMore = data.length === chunkSize; console.debug({ items, hasMore }); + } catch { + items = []; + hasMore = false; } return { items, hasMore }; }