mirror of
https://github.com/sct/overseerr.git
synced 2025-12-29 09:06:08 +01:00
feat(job): media availability support for jellyfin/emby (#522)
* feat(job): media availability support for jellyfin/emby This refactors the media availability job to support jellyfin/emby for media removal automatically. Needs further testing on 4k items (as I have not yet tested with 4k), however, non-4k items work as intended. fix #406, fix #193, fix #516, fix #362, fix #84 * fix(availabilitysync): use the correct 4k jellyfinMediaId * fix: season mapping for plex Fixes a bug introduced with this PR where media availability sync job removed the seasons from all series even when those seasons existed
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import availabilitySync from '@server/lib/availabilitySync';
|
||||
import logger from '@server/logger';
|
||||
import type { AxiosInstance } from 'axios';
|
||||
import axios from 'axios';
|
||||
@@ -241,7 +242,9 @@ class JellyfinAPI {
|
||||
}
|
||||
}
|
||||
|
||||
public async getItemData(id: string): Promise<JellyfinLibraryItemExtended> {
|
||||
public async getItemData(
|
||||
id: string
|
||||
): Promise<JellyfinLibraryItemExtended | undefined> {
|
||||
try {
|
||||
const contents = await this.axios.get<any>(
|
||||
`/Users/${this.userId}/Items/${id}`
|
||||
@@ -249,6 +252,11 @@ class JellyfinAPI {
|
||||
|
||||
return contents.data;
|
||||
} catch (e) {
|
||||
if (availabilitySync.running) {
|
||||
if (e.response && e.response.status === 500) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
logger.error(
|
||||
`Something went wrong while getting library content from the Jellyfin server: ${e.message}`,
|
||||
{ label: 'Jellyfin API' }
|
||||
|
||||
Reference in New Issue
Block a user