fix: missing cover types media organizers (#2328)
This commit is contained in:
@@ -116,7 +116,19 @@ export class LidarrIntegration extends MediaOrganizerIntegration {
|
||||
|
||||
const lidarrCalendarEventImageSchema = z.array(
|
||||
z.object({
|
||||
coverType: z.enum(["screenshot", "poster", "banner", "fanart", "clearlogo", "cover"]),
|
||||
// See https://github.com/Lidarr/Lidarr/blob/bc6417229e9da3d3cab418f92b46eec7a76168c2/src/NzbDrone.Core/MediaCover/MediaCover.cs#L8-L20
|
||||
coverType: z.enum([
|
||||
"unknown",
|
||||
"poster",
|
||||
"banner",
|
||||
"fanart",
|
||||
"screenshot",
|
||||
"headshot",
|
||||
"cover",
|
||||
"disc",
|
||||
"logo",
|
||||
"clearlogo",
|
||||
]),
|
||||
remoteUrl: z.string().url(),
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -7,11 +7,15 @@ export abstract class MediaOrganizerIntegration extends Integration {
|
||||
* We do this to attempt to find the best quality image for the show.
|
||||
*/
|
||||
protected readonly priorities: string[] = [
|
||||
"cover", // Official, perfect aspect ratio
|
||||
"cover", // Official, perfect aspect ratio, best for music
|
||||
"poster", // Official, perfect aspect ratio
|
||||
"banner", // Official, bad aspect ratio
|
||||
"disc", // Official, second best for music / books
|
||||
"logo", // Official, possibly unrelated
|
||||
"fanart", // Unofficial, possibly bad quality
|
||||
"screenshot", // Bad aspect ratio, possibly bad quality
|
||||
"clearlogo", // Without background, bad aspect ratio
|
||||
"clearlogo", // Without background, bad aspect ratio,
|
||||
"headshot", // Unrelated
|
||||
"unknown", // Not known, possibly good or bad, better not to choose
|
||||
];
|
||||
}
|
||||
|
||||
@@ -106,7 +106,8 @@ export class RadarrIntegration extends MediaOrganizerIntegration {
|
||||
|
||||
const radarrCalendarEventImageSchema = z.array(
|
||||
z.object({
|
||||
coverType: z.enum(["screenshot", "poster", "banner", "fanart", "clearlogo"]),
|
||||
// See https://github.com/Radarr/Radarr/blob/a3b1512552a8a5bc0c0d399d961ccbf0dba97749/src/NzbDrone.Core/MediaCover/MediaCover.cs#L6-L15
|
||||
coverType: z.enum(["unknown", "poster", "banner", "fanart", "screenshot", "headshot", "clearlogo"]),
|
||||
remoteUrl: z.string().url(),
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -94,7 +94,19 @@ export class ReadarrIntegration extends MediaOrganizerIntegration {
|
||||
|
||||
const readarrCalendarEventImageSchema = z.array(
|
||||
z.object({
|
||||
coverType: z.enum(["screenshot", "poster", "banner", "fanart", "clearlogo", "cover"]),
|
||||
// See https://github.com/Readarr/Readarr/blob/e5519d60c969105db2f2ab3a8f1cf61814551bb9/src/NzbDrone.Core/MediaCover/MediaCover.cs#L8-L20
|
||||
coverType: z.enum([
|
||||
"unknown",
|
||||
"poster",
|
||||
"banner",
|
||||
"fanart",
|
||||
"screenshot",
|
||||
"headshot",
|
||||
"cover",
|
||||
"disc",
|
||||
"logo",
|
||||
"clearlogo",
|
||||
]),
|
||||
url: z.string().transform((url) => url.replace(/\?lastWrite=[0-9]+/, "")), // returns a random string, needs to be removed for loading the image
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -105,7 +105,8 @@ export class SonarrIntegration extends MediaOrganizerIntegration {
|
||||
|
||||
const sonarrCalendarEventImageSchema = z.array(
|
||||
z.object({
|
||||
coverType: z.enum(["screenshot", "poster", "banner", "fanart", "clearlogo"]),
|
||||
// See https://github.com/Sonarr/Sonarr/blob/9e5ebdc6245d4714776b53127a1e6b63c25fbcb9/src/NzbDrone.Core/MediaCover/MediaCover.cs#L5-L14
|
||||
coverType: z.enum(["unknown", "poster", "banner", "fanart", "screenshot", "headshot", "clearlogo"]),
|
||||
remoteUrl: z.string().url(),
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user