|
|
|
@ -226,12 +226,13 @@ class PlexAPI {
|
|
|
|
|
id: string,
|
|
|
|
|
options: { addedAt: number } = {
|
|
|
|
|
addedAt: Date.now() - 1000 * 60 * 60,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mediaType: 'movie' | 'show'
|
|
|
|
|
): Promise<PlexLibraryItem[]> {
|
|
|
|
|
const response = await this.plexClient.query<PlexLibraryResponse>({
|
|
|
|
|
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`,
|
|
|
|
|