diff --git a/server/api/plexapi.ts b/server/api/plexapi.ts index 03246c810..f6b8f3cb0 100644 --- a/server/api/plexapi.ts +++ b/server/api/plexapi.ts @@ -226,12 +226,13 @@ class PlexAPI { id: string, options: { addedAt: number } = { addedAt: Date.now() - 1000 * 60 * 60, - } + }, + mediaType: 'movie' | 'show' ): Promise { const response = await this.plexClient.query({ - uri: `/library/sections/${id}/all?sort=addedAt%3Adesc&addedAt>>=${Math.floor( - options.addedAt / 1000 - )}`, + uri: `/library/sections/${id}/all?type=${ + mediaType === 'show' ? '4' : '1' + }&sort=addedAt%3Adesc&addedAt>>=${Math.floor(options.addedAt / 1000)}`, extraHeaders: { 'X-Plex-Container-Start': `0`, 'X-Plex-Container-Size': `500`, diff --git a/server/lib/scanners/plex/index.ts b/server/lib/scanners/plex/index.ts index 73e4d9b26..f074872bb 100644 --- a/server/lib/scanners/plex/index.ts +++ b/server/lib/scanners/plex/index.ts @@ -96,7 +96,8 @@ class PlexScanner // We remove 10 minutes from the last scan as a buffer addedAt: library.lastScan - 1000 * 60 * 10, } - : undefined + : undefined, + library.type ); // Bundle items up by rating keys