Compare commits

..

58 Commits

Author SHA1 Message Date
TOomaAh
668a6ae0f8 refactor(settings): remove metadata providers logo 2025-09-01 00:19:20 +02:00
TOomaAh
d7655e520d refactor(tvdb): replace indexer by metadata providers 2025-09-01 00:13:53 +02:00
TOomaAh
82d81fd1d1 style(logs): update error log label from "Metadata" to "MetadataProvider" 2025-08-29 01:01:36 +02:00
TOomaAh
9c072e49d7 style(settings): clarify navigation label from "Metadata" to "Metadata Providers" 2025-08-29 00:51:27 +02:00
TOomaAh
ca52a3e130 fix(scanner): correct metadata provider ID from Tmdb to Tvdb 2025-08-28 23:49:06 +02:00
TOomaAh
c0cc109aab feat(i18n): add missing translations 2025-08-28 23:36:51 +02:00
TOomaAh
be3454ca1e refactor(tvdb): remove unnecessary try/catch block 2025-08-28 23:26:56 +02:00
TOomaAh
04f0506e90 docs(comments): translate from French to English 2025-08-28 23:23:28 +02:00
TOomaAh
04c22ef266 style(wording): standardize naming to "Metadata Provider" in UI text 2025-08-28 23:16:51 +02:00
TOomaAh
61b764b502 chore(i18n): remove french translation + apply i18n:extract 2025-08-28 23:12:27 +02:00
TOomaAh
7814fffc11 style(cypress): fix anime name variable 2025-08-23 00:36:05 +02:00
TOomaAh
ac24c37973 fix(test): fix test with default provider tmdb anime 2025-08-23 00:36:05 +02:00
fallenbagel
d762123a01 chore: add correct application-wide key 2025-08-23 00:36:05 +02:00
fallenbagel
da84b16410 chore: add project-wide apikey for tvdb 2025-08-23 00:36:05 +02:00
TOomaAh
bade7f5139 fix(tests): fix cypress test 2025-08-23 00:36:05 +02:00
TOomaAh
b26689b2da feat(provider): replace indexer by provider 2025-08-23 00:36:05 +02:00
TOomaAh
09d68e6f12 feat(metadata): replace fetch with axios for API calls 2025-08-23 00:36:05 +02:00
TOomaAh
503d8b1c0c refactor(tvdb): remove logger info 2025-08-23 00:36:05 +02:00
TOomaAh
df9921fda1 refactor(tmdb): apply prettier 2025-08-23 00:36:05 +02:00
TOomaAh
e52cb4a7f8 refactor(tvdb): fix apikey 2025-08-23 00:36:05 +02:00
TOomaAh
227533a691 fix(tests): fix all cypress tests 2025-08-23 00:36:05 +02:00
TOomaAh
1618eb954c style(provider): remove french comment 2025-08-23 00:36:05 +02:00
TOomaAh
6e27efcaa7 style(provider): full provider name in select 2025-08-23 00:36:05 +02:00
TOomaAh
c24eebafc0 style(provider): change provider name in info section 2025-08-23 00:36:05 +02:00
TOomaAh
3c310f2319 fix(scanner): fix plex scanner tvdb provider 2025-08-23 00:36:05 +02:00
TOomaAh
3952312884 fix(scanner): fix jellyfin scanner with tvdb provider 2025-08-23 00:36:05 +02:00
TOomaAh
5232950ac8 style(prettier): run prettier 2025-08-23 00:36:05 +02:00
TOomaAh
25c2788047 refactor(metadata): refactor tvdb api calls 2025-08-23 00:36:05 +02:00
TOomaAh
07e8c4698a refactor(metadata): remove french comments 2025-08-23 00:36:05 +02:00
TOomaAh
56f33fe383 refactor(metadata): refactor metadata routes 2025-08-23 00:36:05 +02:00
TOomaAh
4b0652d7ba refactor(metadata): rewrite metadata settings 2025-08-23 00:36:05 +02:00
TOomaAh
4104f3dadd refactor(medata): add tvdb settings 2025-08-23 00:36:05 +02:00
TOomaAh
be91a3f20a fix(tvdb): rename tvdb to medatada 2025-08-23 00:36:05 +02:00
TOomaAh
3c9ed469a8 refactor(tvdb): use tvdb api 2025-08-23 00:36:02 +02:00
TOomaAh
ac76be5014 refactor(tvdb): remove skyhook api 2025-08-23 00:35:17 +02:00
TOomaAh
4dcb308955 fix(scanner): add tvdb indexer for scanner 2025-08-23 00:35:17 +02:00
TOomaAh
5f49a978a9 refactor(swagger): fix /tvdb/test response 2025-08-23 00:35:17 +02:00
TOomaAh
a4ef53e7f1 fix(tvdb): ensure that seasons contain data 2025-08-23 00:35:17 +02:00
TOomaAh
f755a5f1f3 fix(build): revert package.json 2025-08-23 00:35:17 +02:00
TOomaAh
b1548b7e76 fix(tmdb): fix build
fix build after rebase
2025-08-23 00:35:17 +02:00
TOomaAh
9b2c8899da test(tvdb): change 'use' to 'tvdb' condition check 2025-08-23 00:35:17 +02:00
TOomaAh
b45898665e refactor(tmdb): reduce still path condition 2025-08-23 00:35:17 +02:00
TOomaAh
1fb1dc9e1b refactor(settings): replace tvdb object to boolean type 2025-08-23 00:35:17 +02:00
TOomaAh
a54d3c5a65 refactor(indexer): remove unused getSeasonIdentifier method 2025-08-23 00:35:17 +02:00
TOomaAh
5b216abe8d style(tvdb): rename pokemon to correct tv show 2025-08-23 00:35:17 +02:00
TOomaAh
f4997d0aa0 test(tvdb): add tvdb tests 2025-08-23 00:35:17 +02:00
TOomaAh
c5987e2275 fix(test): wrong url tv-details 2025-08-23 00:35:17 +02:00
TOomaAh
3b908af0fe fix(test): fix discover test 2025-08-23 00:35:17 +02:00
TOomaAh
bedc8c4579 style: tvdb.login to tvdb.test 2025-08-23 00:35:17 +02:00
TOomaAh
f912783878 style: replace avalaible to available 2025-08-23 00:35:17 +02:00
TOomaAh
4a19c81e11 fix: wrong language with tmdb indexer 2025-08-23 00:35:17 +02:00
TOomaAh
1fbe4d2031 refactor: clean tvdb indexer code 2025-08-23 00:35:17 +02:00
TOomaAh
7107f1e91f fix: error if tmdb poster is null 2025-08-23 00:35:17 +02:00
TOomaAh
377c6a40a8 fix: error during get episodes 2025-08-23 00:35:16 +02:00
TOomaAh
b88606a1df refactor(tvdb): replace tvdb api by skyhook 2025-08-23 00:35:16 +02:00
TOomaAh
aa7de132be fix(usersettings): remove unused column tvdbtoken 2025-08-23 00:35:16 +02:00
TOomaAh
3906430875 fix: fix rate limiter index tvdb indexer 2025-08-23 00:35:16 +02:00
TOomaAh
26e22e9dba feat(tvdb): get tv seasons/episodes with tvdb 2025-08-23 00:35:16 +02:00
41 changed files with 138 additions and 887 deletions

3
.gitignore vendored
View File

@@ -71,6 +71,3 @@ tsconfig.tsbuildinfo
# Config Cache Directory
config/cache
# Mise
mise.toml

View File

View File

@@ -1451,9 +1451,6 @@ components:
type: string
jsonPayload:
type: string
supportVariables:
type: boolean
example: false
TelegramSettings:
type: object
properties:

View File

@@ -1,211 +0,0 @@
import ExternalAPI from '@server/api/externalapi';
import { ApiErrorCode } from '@server/constants/error';
import { MediaServerType } from '@server/constants/server';
import { getSettings } from '@server/lib/settings';
import logger from '@server/logger';
import { ApiError } from '@server/types/error';
import { getAppVersion } from '@server/utils/appVersion';
import { getHostname } from '@server/utils/getHostname';
import { uniqueId } from 'lodash';
import type { JellyfinLoginResponse } from './jellyfin';
export interface ConnectAuthResponse {
AccessToken: string;
User: {
Id: string;
Name: string;
Email: string;
IsActive: string;
};
}
export interface LinkedServer {
Id: string;
Url: string;
Name: string;
SystemId: string;
AccessKey: string;
LocalAddress: string;
UserType: string;
SupporterKey: string;
}
export interface LocalUserAuthExchangeResponse {
LocalUserId: string;
AccessToken: string;
}
export interface EmbyConnectOptions {
ClientIP?: string;
DeviceId?: string;
}
const EMBY_CONNECT_URL = 'https://connect.emby.media';
class EmbyConnectAPI extends ExternalAPI {
private ClientIP?: string;
private DeviceId?: string;
constructor(options: EmbyConnectOptions = {}) {
super(
EMBY_CONNECT_URL,
{},
{
headers: {
'X-Application': `Jellyseerr/${getAppVersion()}`,
'Content-Type': 'application/json',
Accept: 'application/json',
...(getSettings().main.mediaServerType === MediaServerType.EMBY &&
{}),
},
}
);
this.ClientIP = options.ClientIP;
this.DeviceId = options.DeviceId;
}
public async authenticateConnectUser(Email?: string, Password?: string) {
logger.debug(`Attempting to authenticate via EmbyConnect with email:`, {
Email,
});
const connectAuthResponse = await this.getConnectUserAccessToken(
Email,
Password
);
const linkedServers = await this.getValidServers(
connectAuthResponse.User.Id,
connectAuthResponse.AccessToken
);
const matchingServer = this.findMatchingServer(linkedServers);
const localUserExchangeResponse = await this.localAuthExchange(
matchingServer.AccessKey,
connectAuthResponse.User.Id,
this.DeviceId
);
return {
User: {
Name: connectAuthResponse.User.Name,
Email: connectAuthResponse.User.Email,
ServerId: matchingServer.SystemId,
ServerName: matchingServer.Name,
Id: localUserExchangeResponse.LocalUserId,
Configuration: {
GroupedFolders: [],
},
Policy: {
IsAdministrator: false, // This requires an additional EmbyServer API call, skipping for now
},
},
AccessToken: localUserExchangeResponse.AccessToken,
} as JellyfinLoginResponse;
}
private async getConnectUserAccessToken(
Email?: string,
Password?: string
): Promise<ConnectAuthResponse> {
try {
const response = await this.post<ConnectAuthResponse>(
'/service/user/authenticate',
{ nameOrEmail: Email, rawpw: Password },
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
}
);
return response;
} catch (e) {
logger.debug(`Failed to authenticate using EmbyConnect:`, {
label: 'EmbyConnect API',
ip: this.ClientIP,
error: e.message,
});
throw new ApiError(
e.cause?.status ?? 401,
ApiErrorCode.InvalidCredentials
);
}
}
private async getValidServers(
ConnectUserId: string,
AccessToken: string
): Promise<LinkedServer[]> {
try {
const response = await this.get<LinkedServer[]>(`/service/servers`, {
params: { userId: ConnectUserId },
headers: {
'X-Connect-UserToken': AccessToken,
},
});
return response;
} catch (e) {
logger.error(`Failed to retrieve EmbyConnect user server list: `, {
label: 'EmbyConnect API',
ip: this.ClientIP,
error: e.message,
});
throw new ApiError(e.cause?.status, ApiErrorCode.InvalidAuthToken);
}
}
private findMatchingServer(linkedEmbyServers: LinkedServer[]): LinkedServer {
const settings = getSettings();
const matchingServer = linkedEmbyServers.find(
(server) => server.SystemId === settings.jellyfin.serverId
);
if (!matchingServer) {
throw new Error(
`No matching linked Emby server found for serverId: ${settings.jellyfin.serverId}`
);
}
return matchingServer;
}
private async localAuthExchange(
accessKey: string,
userId: string,
deviceId?: string
): Promise<LocalUserAuthExchangeResponse> {
try {
const params = new URLSearchParams({
format: 'json',
ConnectUserId: userId,
'X-Emby-Client': 'Jellyseerr',
'X-Emby-Device-Id': deviceId ?? uniqueId(),
'X-Emby-Client-Version': getAppVersion(),
'X-Emby-Device-Name': 'Jellyseerr',
'X-Emby-Token': accessKey,
});
const response = await fetch(
`${getHostname()}/emby/Connect/Exchange?${params}`,
{
headers: {
'Content-Type': 'application/json',
},
}
);
if (!response.ok) {
throw new Error(response.statusText, { cause: response });
}
return await response.json();
} catch (e) {
logger.debug('Failed local user auth exchange', e.cause);
throw new ApiError(e.cause?.status, ApiErrorCode.InvalidAuthToken);
}
}
}
export default EmbyConnectAPI;

View File

@@ -3,7 +3,6 @@ import type { AxiosInstance, AxiosRequestConfig } from 'axios';
import axios from 'axios';
import rateLimit from 'axios-rate-limit';
import type NodeCache from 'node-cache';
import querystring from 'querystring';
// 5 minute default TTL (in seconds)
const DEFAULT_TTL = 300;
@@ -83,7 +82,6 @@ class ExternalAPI {
): Promise<T> {
const cacheKey = this.serializeCacheKey(endpoint, {
config: config?.params,
headers: config?.headers,
...(data ? { data } : {}),
});
@@ -92,16 +90,7 @@ class ExternalAPI {
return cachedItem;
}
const isFormUrlEncoded = (
config?.headers?.['Content-Type'] as string
)?.includes('application/x-www-form-urlencoded');
const body =
data && isFormUrlEncoded
? querystring.stringify(data as Record<string, string>)
: data;
const response = await this.axios.post<T>(endpoint, body, config);
const response = await this.axios.post<T>(endpoint, data, config);
if (this.cache && ttl !== 0) {
this.cache.set(cacheKey, response.data, ttl ?? DEFAULT_TTL);

View File

@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import EmbyConnectAPI from '@server/api/embyconnect';
import ExternalAPI from '@server/api/externalapi';
import { ApiErrorCode } from '@server/constants/error';
import { MediaServerType } from '@server/constants/server';
@@ -8,11 +7,9 @@ import { getSettings } from '@server/lib/settings';
import logger from '@server/logger';
import { ApiError } from '@server/types/error';
import { getAppVersion } from '@server/utils/appVersion';
import * as EmailValidator from 'email-validator';
export interface JellyfinUserResponse {
Name: string;
Email?: string;
ServerId: string;
ServerName: string;
Id: string;
@@ -122,7 +119,6 @@ export interface JellyfinItemsReponse {
class JellyfinAPI extends ExternalAPI {
private userId?: string;
private deviceId?: string;
private mediaServerType: MediaServerType;
constructor(
@@ -154,7 +150,7 @@ class JellyfinAPI extends ExternalAPI {
},
}
);
this.deviceId = deviceId ? deviceId : undefined;
this.mediaServerType = settings.main.mediaServerType;
}
@@ -177,31 +173,6 @@ class JellyfinAPI extends ExternalAPI {
);
};
if (
getSettings().main.mediaServerType === MediaServerType.EMBY &&
Username &&
EmailValidator.validate(Username)
) {
try {
const connectApi = new EmbyConnectAPI({
ClientIP: ClientIP,
DeviceId: this.deviceId,
});
return await connectApi.authenticateConnectUser(Username, Password);
} catch (e) {
// Possible local Emby user with email as username
logger.warn(
`Emby Connect authentication failed: ${e}, attempting local Emby server authentication`,
{
label: 'Jellyfin API',
error:
e.cause?.message ?? e.cause?.statusText ?? ApiErrorCode.Unknown,
ip: ClientIP,
}
);
}
}
try {
return await authenticate(true);
} catch (e) {
@@ -274,9 +245,9 @@ class JellyfinAPI extends ExternalAPI {
public async getUsers(): Promise<JellyfinUserListResponse> {
try {
const userResponse = await this.get<JellyfinUserResponse[]>(`/Users`);
const userReponse = await this.get<JellyfinUserResponse[]>(`/Users`);
return { users: userResponse };
return { users: userReponse };
} catch (e) {
logger.error(
`Something went wrong while getting the account from the Jellyfin server: ${e.message}`,
@@ -289,10 +260,10 @@ class JellyfinAPI extends ExternalAPI {
public async getUser(): Promise<JellyfinUserResponse> {
try {
const userResponse = await this.get<JellyfinUserResponse>(
const userReponse = await this.get<JellyfinUserResponse>(
`/Users/${this.userId ?? 'Me'}`
);
return userResponse;
return userReponse;
} catch (e) {
logger.error(
`Something went wrong while getting the account from the Jellyfin server: ${e.message}`,

View File

@@ -7,13 +7,12 @@ import type {
TmdbTvEpisodeResult,
TmdbTvSeasonResult,
} from '@server/api/themoviedb/interfaces';
import {
convertTmdbLanguageToTvdbWithFallback,
type TvdbBaseResponse,
type TvdbEpisode,
type TvdbLoginResponse,
type TvdbSeasonDetails,
type TvdbTvDetails,
import type {
TvdbBaseResponse,
TvdbEpisode,
TvdbLoginResponse,
TvdbSeasonDetails,
TvdbTvDetails,
} from '@server/api/tvdb/interfaces';
import cacheManager, { type AvailableCacheIds } from '@server/lib/cache';
import logger from '@server/logger';
@@ -204,6 +203,10 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
seasonNumber: number;
language?: string;
}): Promise<TmdbSeasonWithEpisodes> {
if (seasonNumber === 0) {
return this.createEmptySeasonResponse(tvId);
}
try {
const tmdbTvShow = await this.tmdb.getTvShow({ tvId, language });
@@ -216,12 +219,7 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
return await this.tmdb.getTvSeason({ tvId, seasonNumber, language });
}
return await this.getTvdbSeasonData(
tvdbId,
seasonNumber,
tvId,
language
);
return await this.getTvdbSeasonData(tvdbId, seasonNumber, tvId);
} catch (error) {
this.handleError('Failed to fetch TV season details', error);
return await this.tmdb.getTvSeason({ tvId, seasonNumber, language });
@@ -277,12 +275,12 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
}
const seasons = tvdbData.seasons
.filter((season) => season.type && season.type.type === 'official')
.sort((a, b) => a.number - b.number)
.map((season) => this.createSeasonData(season, tvdbData))
.filter(
(season) => season && season.season_number >= 0
) as TmdbTvSeasonResult[];
(season) =>
season.number > 0 && season.type && season.type.type === 'official'
)
.sort((a, b) => a.number - b.number)
.map((season) => this.createSeasonData(season, tvdbData));
return seasons;
}
@@ -291,14 +289,13 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
season: TvdbSeasonDetails,
tvdbData: TvdbTvDetails
): TmdbTvSeasonResult {
const seasonNumber = season.number ?? -1;
if (seasonNumber < 0) {
if (!season.number) {
return {
id: 0,
episode_count: 0,
name: '',
overview: '',
season_number: -1,
season_number: 0,
poster_path: '',
air_date: '',
};
@@ -322,8 +319,8 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
private async getTvdbSeasonData(
tvdbId: number,
seasonNumber: number,
tvId: number,
language: string = Tvdb.DEFAULT_LANGUAGE
tvId: number
//language: string = Tvdb.DEFAULT_LANGUAGE
): Promise<TmdbSeasonWithEpisodes> {
const tvdbData = await this.fetchTvdbShowData(tvdbId);
@@ -347,132 +344,6 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
return this.createEmptySeasonResponse(tvId);
}
const wantedTranslation = convertTmdbLanguageToTvdbWithFallback(
language,
Tvdb.DEFAULT_LANGUAGE
);
// check if translation is available for the season
const availableTranslation = season.nameTranslations.filter(
(translation) =>
translation === wantedTranslation ||
translation === Tvdb.DEFAULT_LANGUAGE
);
if (!availableTranslation) {
return this.getSeasonWithOriginalLanguage(
tvdbId,
tvId,
seasonNumber,
season
);
}
return this.getSeasonWithTranslation(
tvdbId,
tvId,
seasonNumber,
season,
wantedTranslation
);
}
private async getSeasonWithTranslation(
tvdbId: number,
tvId: number,
seasonNumber: number,
season: TvdbSeasonDetails,
language: string
): Promise<TmdbSeasonWithEpisodes> {
if (!season) {
logger.error(
`Failed to find season ${seasonNumber} for TVDB ID: ${tvdbId}`
);
return this.createEmptySeasonResponse(tvId);
}
const allEpisodes = [] as TvdbEpisode[];
let page = 0;
// Limit to max 50 pages to avoid infinite loops.
// 50 pages with 500 items per page = 25_000 episodes in a series which should be more than enough
const maxPages = 50;
while (page < maxPages) {
const resp = await this.get<TvdbBaseResponse<TvdbSeasonDetails>>(
`/series/${tvdbId}/episodes/default/${language}`,
{
headers: {
Authorization: `Bearer ${this.token}`,
},
params: {
page: page,
},
}
);
if (!resp?.data?.episodes) {
logger.warn(
`No episodes found for TVDB ID: ${tvdbId} on page ${page} for season ${seasonNumber}`
);
break;
}
const { episodes } = resp.data;
if (!episodes) {
logger.debug(
`No more episodes found for TVDB ID: ${tvdbId} on page ${page} for season ${seasonNumber}`
);
break;
}
allEpisodes.push(...episodes);
const hasNextPage = resp.links?.next && episodes.length > 0;
if (!hasNextPage) {
break;
}
page++;
}
if (page >= maxPages) {
logger.warn(
`Reached max pages (${maxPages}) for TVDB ID: ${tvdbId} on season ${seasonNumber} with language ${language}. There might be more episodes available.`
);
}
const episodes = this.processEpisodes(
{ ...season, episodes: allEpisodes },
seasonNumber,
tvId
);
return {
episodes,
external_ids: { tvdb_id: tvdbId },
name: '',
overview: '',
id: season.id,
air_date: season.firstAired,
season_number: episodes.length,
};
}
private async getSeasonWithOriginalLanguage(
tvdbId: number,
tvId: number,
seasonNumber: number,
season: TvdbSeasonDetails
): Promise<TmdbSeasonWithEpisodes> {
if (!season) {
logger.error(
`Failed to find season ${seasonNumber} for TVDB ID: ${tvdbId}`
);
return this.createEmptySeasonResponse(tvId);
}
const resp = await this.get<TvdbBaseResponse<TvdbSeasonDetails>>(
`/seasons/${season.id}/extended`,
{
@@ -526,10 +397,7 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
season_number: episode.seasonNumber,
production_code: '',
show_id: tvId,
still_path:
episode.image && !episode.image.startsWith('https://')
? 'https://artworks.thetvdb.com' + episode.image
: '',
still_path: episode.image ? episode.image : '',
vote_average: 1,
vote_count: 1,
};

View File

@@ -1,17 +1,6 @@
import { type AvailableLocale } from '@server/types/languages';
export interface TvdbBaseResponse<T> {
data: T;
errors: string;
links?: TvdbPagination;
}
export interface TvdbPagination {
prev?: string;
self: string;
next?: string;
totalItems: number;
pageSize: number;
}
export interface TvdbLoginResponse {
@@ -153,64 +142,3 @@ export interface TvdbEpisodeTranslation {
overview: string;
language: string;
}
const TMDB_TO_TVDB_MAPPING: Record<string, string> & {
[key in AvailableLocale]: string;
} = {
ar: 'ara', // Arabic
bg: 'bul', // Bulgarian
ca: 'cat', // Catalan
cs: 'ces', // Czech
da: 'dan', // Danish
de: 'deu', // German
el: 'ell', // Greek
en: 'eng', // English
es: 'spa', // Spanish
fi: 'fin', // Finnish
fr: 'fra', // French
he: 'heb', // Hebrew
hi: 'hin', // Hindi
hr: 'hrv', // Croatian
hu: 'hun', // Hungarian
it: 'ita', // Italian
ja: 'jpn', // Japanese
ko: 'kor', // Korean
lt: 'lit', // Lithuanian
nl: 'nld', // Dutch
pl: 'pol', // Polish
ro: 'ron', // Romanian
ru: 'rus', // Russian
sq: 'sqi', // Albanian
sr: 'srp', // Serbian
sv: 'swe', // Swedish
tr: 'tur', // Turkish
uk: 'ukr', // Ukrainian
'es-MX': 'spa', // Spanish (Latin America) -> Spanish
'nb-NO': 'nor', // Norwegian Bokmål -> Norwegian
'pt-BR': 'pt', // Portuguese (Brazil) -> Portuguese - Brazil (from TVDB data)
'pt-PT': 'por', // Portuguese (Portugal) -> Portuguese - Portugal (from TVDB data)
'zh-CN': 'zho', // Chinese (Simplified) -> Chinese - China
'zh-TW': 'zhtw', // Chinese (Traditional) -> Chinese - Taiwan
};
export function convertTMDBToTVDB(tmdbCode: string): string | null {
const normalizedCode = tmdbCode.toLowerCase();
return (
TMDB_TO_TVDB_MAPPING[tmdbCode] ||
TMDB_TO_TVDB_MAPPING[normalizedCode] ||
null
);
}
export function convertTmdbLanguageToTvdbWithFallback(
tmdbCode: string,
fallback: string
): string {
// First try exact match
const tvdbCode = convertTMDBToTVDB(tmdbCode);
if (tvdbCode) return tvdbCode;
return tvdbCode || fallback || 'eng'; // Default to English if no match found
}

View File

@@ -109,9 +109,7 @@ class DiscordAgent
type: Notification,
payload: NotificationPayload
): DiscordRichEmbed {
const settings = getSettings();
const { applicationUrl } = settings.main;
const { embedPoster } = settings.notifications.agents.discord;
const { applicationUrl } = getSettings().main;
const appUrl =
applicationUrl || `http://localhost:${process.env.port || 5055}`;
@@ -225,11 +223,9 @@ class DiscordAgent
}
: undefined,
fields,
thumbnail: embedPoster
? {
url: payload.image,
}
: undefined,
thumbnail: {
url: payload.image,
},
};
}

View File

@@ -48,9 +48,7 @@ class EmailAgent
recipientEmail: string,
recipientName?: string
): EmailOptions | undefined {
const settings = getSettings();
const { applicationUrl, applicationTitle } = settings.main;
const { embedPoster } = settings.notifications.agents.email;
const { applicationUrl, applicationTitle } = getSettings().main;
if (type === Notification.TEST_NOTIFICATION) {
return {
@@ -131,7 +129,7 @@ class EmailAgent
body,
mediaName: payload.subject,
mediaExtra: payload.extra ?? [],
imageUrl: embedPoster ? payload.image : undefined,
imageUrl: payload.image,
timestamp: new Date().toTimeString(),
requestedBy: payload.request.requestedBy.displayName,
actionUrl: applicationUrl
@@ -178,7 +176,7 @@ class EmailAgent
issueComment: payload.comment?.message,
mediaName: payload.subject,
extra: payload.extra ?? [],
imageUrl: embedPoster ? payload.image : undefined,
imageUrl: payload.image,
timestamp: new Date().toTimeString(),
actionUrl: applicationUrl
? `${applicationUrl}/issues/${payload.issue.id}`

View File

@@ -22,9 +22,7 @@ class NtfyAgent
}
private buildPayload(type: Notification, payload: NotificationPayload) {
const settings = getSettings();
const { applicationUrl } = settings.main;
const { embedPoster } = settings.notifications.agents.ntfy;
const { applicationUrl } = getSettings().main;
const topic = this.getSettings().options.topic;
const priority = 3;
@@ -74,7 +72,7 @@ class NtfyAgent
message += `\n\n**${extra.name}**\n${extra.value}`;
}
const attach = embedPoster ? payload.image : undefined;
const attach = payload.image;
let click;
if (applicationUrl && payload.media) {

View File

@@ -78,9 +78,7 @@ class PushoverAgent
type: Notification,
payload: NotificationPayload
): Promise<Partial<PushoverPayload>> {
const settings = getSettings();
const { applicationUrl, applicationTitle } = settings.main;
const { embedPoster } = settings.notifications.agents.pushover;
const { applicationUrl, applicationTitle } = getSettings().main;
const title = payload.event ?? payload.subject;
let message = payload.event ? `<b>${payload.subject}</b>` : '';
@@ -157,7 +155,7 @@ class PushoverAgent
let attachment_base64;
let attachment_type;
if (embedPoster && payload.image) {
if (payload.image) {
const imagePayload = await this.getImagePayload(payload.image);
if (imagePayload.attachment_base64 && imagePayload.attachment_type) {
attachment_base64 = imagePayload.attachment_base64;

View File

@@ -63,9 +63,7 @@ class SlackAgent
type: Notification,
payload: NotificationPayload
): SlackBlockEmbed {
const settings = getSettings();
const { applicationUrl, applicationTitle } = settings.main;
const { embedPoster } = settings.notifications.agents.slack;
const { applicationUrl, applicationTitle } = getSettings().main;
const fields: EmbedField[] = [];
@@ -161,14 +159,13 @@ class SlackAgent
type: 'mrkdwn',
text: payload.message,
},
accessory:
embedPoster && payload.image
? {
type: 'image',
image_url: payload.image,
alt_text: payload.subject,
}
: undefined,
accessory: payload.image
? {
type: 'image',
image_url: payload.image,
alt_text: payload.subject,
}
: undefined,
});
}

View File

@@ -65,9 +65,7 @@ class TelegramAgent
type: Notification,
payload: NotificationPayload
): Partial<TelegramMessagePayload | TelegramPhotoPayload> {
const settings = getSettings();
const { applicationUrl, applicationTitle } = settings.main;
const { embedPoster } = settings.notifications.agents.telegram;
const { applicationUrl, applicationTitle } = getSettings().main;
/* eslint-disable no-useless-escape */
let message = `\*${this.escapeText(
@@ -144,7 +142,7 @@ class TelegramAgent
}
/* eslint-enable */
return embedPoster && payload.image
return payload.image
? {
photo: payload.image,
caption: message,
@@ -162,7 +160,7 @@ class TelegramAgent
): Promise<boolean> {
const settings = this.getSettings();
const endpoint = `${this.baseUrl}bot${settings.options.botAPI}/${
settings.embedPoster && payload.image ? 'sendPhoto' : 'sendMessage'
payload.image ? 'sendPhoto' : 'sendMessage'
}`;
const notificationPayload = this.getNotificationPayload(type, payload);

View File

@@ -177,27 +177,9 @@ class WebhookAgent
subject: payload.subject,
});
let webhookUrl = settings.options.webhookUrl;
if (settings.options.supportVariables) {
Object.keys(KeyMap).forEach((keymapKey) => {
const keymapValue = KeyMap[keymapKey as keyof typeof KeyMap];
const variableValue =
type === Notification.TEST_NOTIFICATION
? 'test'
: typeof keymapValue === 'function'
? keymapValue(payload, type)
: get(payload, keymapValue) || 'test';
webhookUrl = webhookUrl.replace(
new RegExp(`{{${keymapKey}}}`, 'g'),
encodeURIComponent(variableValue)
);
});
}
try {
await axios.post(
webhookUrl,
settings.options.webhookUrl,
this.buildPayload(type, payload),
settings.options.authHeader
? {

View File

@@ -42,8 +42,6 @@ class WebPushAgent
type: Notification,
payload: NotificationPayload
): PushNotificationPayload {
const { embedPoster } = getSettings().notifications.agents.webpush;
const mediaType = payload.media
? payload.media.mediaType === MediaType.MOVIE
? 'movie'
@@ -130,7 +128,7 @@ class WebPushAgent
notificationType: Notification[type],
subject: payload.subject,
message,
image: embedPoster ? payload.image : undefined,
image: payload.image,
requestId: payload.request?.id,
actionUrl,
actionUrlTitle,

View File

@@ -207,7 +207,6 @@ interface FullPublicSettings extends PublicSettings {
export interface NotificationAgentConfig {
enabled: boolean;
embedPoster: boolean;
types?: number;
options: Record<string, unknown>;
}
@@ -275,7 +274,6 @@ export interface NotificationAgentWebhook extends NotificationAgentConfig {
webhookUrl: string;
jsonPayload: string;
authHeader?: string;
supportVariables?: boolean;
};
}
@@ -436,7 +434,6 @@ class Settings {
agents: {
email: {
enabled: false,
embedPoster: true,
options: {
userEmailRequired: false,
emailFrom: '',
@@ -451,7 +448,6 @@ class Settings {
},
discord: {
enabled: false,
embedPoster: true,
types: 0,
options: {
webhookUrl: '',
@@ -461,7 +457,6 @@ class Settings {
},
slack: {
enabled: false,
embedPoster: true,
types: 0,
options: {
webhookUrl: '',
@@ -469,7 +464,6 @@ class Settings {
},
telegram: {
enabled: false,
embedPoster: true,
types: 0,
options: {
botAPI: '',
@@ -480,7 +474,6 @@ class Settings {
},
pushbullet: {
enabled: false,
embedPoster: false,
types: 0,
options: {
accessToken: '',
@@ -488,7 +481,6 @@ class Settings {
},
pushover: {
enabled: false,
embedPoster: true,
types: 0,
options: {
accessToken: '',
@@ -498,7 +490,6 @@ class Settings {
},
webhook: {
enabled: false,
embedPoster: true,
types: 0,
options: {
webhookUrl: '',
@@ -508,12 +499,10 @@ class Settings {
},
webpush: {
enabled: false,
embedPoster: true,
options: {},
},
gotify: {
enabled: false,
embedPoster: false,
types: 0,
options: {
url: '',
@@ -523,7 +512,6 @@ class Settings {
},
ntfy: {
enabled: false,
embedPoster: true,
types: 0,
options: {
url: '',

View File

@@ -42,6 +42,7 @@ authRoutes.get('/me', isAuthenticated(), async (req, res) => {
user.warnings.push('userEmailRequired');
logger.warn(`User ${user.username} has no valid email address`);
}
return res.status(200).json(user);
});
@@ -415,34 +416,25 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
}
// User already exists, let's update their information
else if (account.User.Id === user?.jellyfinUserId) {
const serverType =
settings.main.mediaServerType === MediaServerType.JELLYFIN
? ServerType.JELLYFIN
: ServerType.EMBY;
const userType =
serverType === ServerType.JELLYFIN ? UserType.JELLYFIN : UserType.EMBY;
logger.info(
`Found matching ${serverType} user; updating user with ${serverType}`,
`Found matching ${
settings.main.mediaServerType === MediaServerType.JELLYFIN
? ServerType.JELLYFIN
: ServerType.EMBY
} user; updating user with ${
settings.main.mediaServerType === MediaServerType.JELLYFIN
? ServerType.JELLYFIN
: ServerType.EMBY
}`,
{
label: 'API',
ip: req.ip,
jellyfinUsername: account.User.Name,
}
);
user.userType = userType;
user.avatar = getUserAvatarUrl(user);
user.jellyfinUsername = account.User.Name;
if (
account.User.Email !== undefined &&
user.email !== account.User.Email
) {
user.email = account.User.Email;
}
if (user.username === account.User.Name) {
user.username = '';
}
@@ -463,59 +455,34 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
message: 'Access denied.',
});
} else if (!user) {
// Handle Emby Connect user with unlinked local account
if (
settings.main.mediaServerType === MediaServerType.EMBY &&
account.User.Email &&
account.User.Email.trim() !== ''
) {
user = await userRepository.findOne({
where: { email: account.User.Email },
});
}
if (user) {
logger.info(
`Sign in attempt from EmbyConnect user with access to the media server, linking users`
);
user.avatar = getUserAvatarUrl(user);
user.jellyfinUserId = account.User.Id;
user.userType = UserType.EMBY;
user.username = account.User.Name;
await userRepository.save(user);
// No user, create new
} else {
logger.info(
'Sign-in attempt from Jellyfin/Emby user with access to the media server; creating new Jellyseerr user',
{
label: 'API',
ip: req.ip,
jellyfinUsername: account.User.Name,
}
);
user = new User({
email: body.email,
logger.info(
'Sign-in attempt from Jellyfin user with access to the media server; creating new Jellyseerr user',
{
label: 'API',
ip: req.ip,
jellyfinUsername: account.User.Name,
jellyfinUserId: account.User.Id,
jellyfinDeviceId: deviceId,
permissions: settings.main.defaultPermissions,
userType:
settings.main.mediaServerType === MediaServerType.JELLYFIN
? UserType.JELLYFIN
: UserType.EMBY,
});
user.avatar = getUserAvatarUrl(user);
//initialize Jellyfin/Emby users with local login
const passedExplicitPassword =
body.password && body.password.length > 0;
if (passedExplicitPassword) {
await user.setPassword(body.password ?? '');
}
await userRepository.save(user);
);
user = new User({
email: body.email,
jellyfinUsername: account.User.Name,
jellyfinUserId: account.User.Id,
jellyfinDeviceId: deviceId,
permissions: settings.main.defaultPermissions,
userType:
settings.main.mediaServerType === MediaServerType.JELLYFIN
? UserType.JELLYFIN
: UserType.EMBY,
});
user.avatar = getUserAvatarUrl(user);
//initialize Jellyfin/Emby users with local login
const passedExplicitPassword = body.password && body.password.length > 0;
if (passedExplicitPassword) {
await user.setPassword(body.password ?? '');
}
await userRepository.save(user);
}
if (user && user.jellyfinUserId) {

View File

@@ -54,7 +54,6 @@ issueRoutes.get<Record<string, string>, IssueResultsResponse>(
.leftJoinAndSelect('issue.createdBy', 'createdBy')
.leftJoinAndSelect('issue.media', 'media')
.leftJoinAndSelect('issue.modifiedBy', 'modifiedBy')
.leftJoinAndSelect('issue.comments', 'comments')
.where('issue.status IN (:...issueStatus)', {
issueStatus: statusFilter,
});

View File

@@ -270,7 +270,6 @@ notificationRoutes.get('/webhook', (_req, res) => {
const response: typeof webhookSettings = {
enabled: webhookSettings.enabled,
embedPoster: webhookSettings.embedPoster,
types: webhookSettings.types,
options: {
...webhookSettings.options,
@@ -279,7 +278,6 @@ notificationRoutes.get('/webhook', (_req, res) => {
'utf8'
)
),
supportVariables: webhookSettings.options.supportVariables ?? false,
},
};
@@ -293,7 +291,6 @@ notificationRoutes.post('/webhook', async (req, res, next) => {
settings.notifications.agents.webhook = {
enabled: req.body.enabled,
embedPoster: req.body.embedPoster,
types: req.body.types,
options: {
jsonPayload: Buffer.from(req.body.options.jsonPayload).toString(
@@ -301,7 +298,6 @@ notificationRoutes.post('/webhook', async (req, res, next) => {
),
webhookUrl: req.body.options.webhookUrl,
authHeader: req.body.options.authHeader,
supportVariables: req.body.options.supportVariables ?? false,
},
};
await settings.save();
@@ -325,7 +321,6 @@ notificationRoutes.post('/webhook/test', async (req, res, next) => {
const testBody = {
enabled: req.body.enabled,
embedPoster: req.body.embedPoster,
types: req.body.types,
options: {
jsonPayload: Buffer.from(req.body.options.jsonPayload).toString(
@@ -333,7 +328,6 @@ notificationRoutes.post('/webhook/test', async (req, res, next) => {
),
webhookUrl: req.body.options.webhookUrl,
authHeader: req.body.options.authHeader,
supportVariables: req.body.options.supportVariables ?? false,
},
};

View File

@@ -80,7 +80,6 @@ tvRoutes.get('/:id/season/:seasonNumber', async (req, res, next) => {
const season = await metadataProvider.getTvSeason({
tvId: Number(req.params.id),
seasonNumber: Number(req.params.seasonNumber),
language: (req.query.language as string) ?? req.locale,
});
return res.status(200).json(mapSeasonWithEpisodes(season));

View File

@@ -53,11 +53,10 @@ div(style='display: block; background-color: #111827; padding: 2.5rem 0;')
b(style='color: #9ca3af; font-weight: 700;')
| #{extra.name}&nbsp;
| #{extra.value}
if imageUrl
td(rowspan='2' style='width: 7rem;')
a(style='display: block; width: 7rem; overflow: hidden; border-radius: .375rem;' href=actionUrl)
div(style='overflow: hidden; box-sizing: border-box; margin: 0px;')
img(alt='' src=imageUrl style='box-sizing: border-box; padding: 0px; border: none; margin: auto; display: block; min-width: 100%; max-width: 100%; min-height: 100%; max-height: 100%;')
td(rowspan='2' style='width: 7rem;')
a(style='display: block; width: 7rem; overflow: hidden; border-radius: .375rem;' href=actionUrl)
div(style='overflow: hidden; box-sizing: border-box; margin: 0px;')
img(alt='' src=imageUrl style='box-sizing: border-box; padding: 0px; border: none; margin: auto; display: block; min-width: 100%; max-width: 100%; min-height: 100%; max-height: 100%;')
tr
td(style='font-size: .85em; color: #9ca3af; line-height: 1em; vertical-align: bottom; margin-right: 1rem')
span

View File

@@ -1,35 +0,0 @@
export type AvailableLocale =
| 'ar'
| 'bg'
| 'ca'
| 'cs'
| 'da'
| 'de'
| 'en'
| 'el'
| 'es'
| 'es-MX'
| 'fi'
| 'fr'
| 'hr'
| 'he'
| 'hi'
| 'hu'
| 'it'
| 'ja'
| 'ko'
| 'lt'
| 'nb-NO'
| 'nl'
| 'pl'
| 'pt-BR'
| 'pt-PT'
| 'ro'
| 'ru'
| 'sq'
| 'sr'
| 'sv'
| 'tr'
| 'uk'
| 'zh-CN'
| 'zh-TW';

View File

@@ -1,7 +1,6 @@
import Badge from '@app/components/Common/Badge';
import Button from '@app/components/Common/Button';
import CachedImage from '@app/components/Common/CachedImage';
import Tooltip from '@app/components/Common/Tooltip';
import { issueOptions } from '@app/components/IssueModal/constants';
import { Permission, useUser } from '@app/hooks/useUser';
import globalMessages from '@app/i18n/globalMessages';
@@ -27,7 +26,6 @@ const messages = defineMessages('components.IssueList.IssueItem', {
opened: 'Opened',
viewissue: 'View Issue',
unknownissuetype: 'Unknown',
descriptionpreview: 'Issue Description',
});
const isMovie = (movie: MovieDetails | TvDetails): movie is MovieDetails => {
@@ -109,15 +107,8 @@ const IssueItem = ({ issue }: IssueItemProps) => {
}
}
const description = issue.comments?.[0]?.message || '';
const maxDescriptionLength = 120;
const shouldTruncate = description.length > maxDescriptionLength;
const truncatedDescription = shouldTruncate
? description.substring(0, maxDescriptionLength) + '...'
: description;
return (
<div className="relative flex w-full flex-col justify-between overflow-hidden rounded-xl bg-gray-800 py-4 text-gray-400 shadow-md ring-1 ring-gray-700 xl:flex-row">
<div className="relative flex w-full flex-col justify-between overflow-hidden rounded-xl bg-gray-800 py-4 text-gray-400 shadow-md ring-1 ring-gray-700 xl:h-28 xl:flex-row">
{title.backdropPath && (
<div className="absolute inset-0 z-0 w-full bg-cover bg-center xl:w-2/3">
<CachedImage
@@ -177,38 +168,8 @@ const IssueItem = ({ issue }: IssueItemProps) => {
>
{isMovie(title) ? title.title : title.name}
</Link>
{description && (
<div className="mt-1 max-w-full">
<div className="overflow-hidden text-sm text-gray-300">
{shouldTruncate ? (
<Tooltip
content={
<div className="max-w-sm p-3">
<div className="mb-1 text-sm font-medium text-gray-200">
Issue Description
</div>
<div className="whitespace-pre-wrap text-sm leading-relaxed text-gray-300">
{description}
</div>
</div>
}
tooltipConfig={{
placement: 'top',
offset: [0, 8],
}}
>
<span className="block cursor-help truncate transition-colors hover:text-gray-200">
{truncatedDescription}
</span>
</Tooltip>
) : (
<span className="block break-words">{description}</span>
)}
</div>
</div>
)}
{problemSeasonEpisodeLine.length > 0 && (
<div className="card-field mt-1">
<div className="card-field">
{problemSeasonEpisodeLine.map((t, k) => (
<span key={k}>{t}</span>
))}

View File

@@ -1,10 +1,10 @@
import type { AvailableLocale } from '@app/context/LanguageContext';
import { availableLanguages } from '@app/context/LanguageContext';
import useClickOutside from '@app/hooks/useClickOutside';
import useLocale from '@app/hooks/useLocale';
import defineMessages from '@app/utils/defineMessages';
import { Transition } from '@headlessui/react';
import { LanguageIcon } from '@heroicons/react/24/solid';
import type { AvailableLocale } from '@server/types/languages';
import { useRef, useState } from 'react';
import { useIntl } from 'react-intl';

View File

@@ -3,11 +3,11 @@ import PullToRefresh from '@app/components/Layout/PullToRefresh';
import SearchInput from '@app/components/Layout/SearchInput';
import Sidebar from '@app/components/Layout/Sidebar';
import UserDropdown from '@app/components/Layout/UserDropdown';
import type { AvailableLocale } from '@app/context/LanguageContext';
import useLocale from '@app/hooks/useLocale';
import useSettings from '@app/hooks/useSettings';
import { useUser } from '@app/hooks/useUser';
import { ArrowLeftIcon, Bars3BottomLeftIcon } from '@heroicons/react/24/solid';
import type { AvailableLocale } from '@server/types/languages';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import useSWR from 'swr';

View File

@@ -14,7 +14,6 @@ import * as Yup from 'yup';
const messages = defineMessages('components.Login', {
loginwithapp: 'Login with {appName}',
username: 'Username',
email: 'Email Address',
password: 'Password',
validationusernamerequired: 'Username required',
validationpasswordrequired: 'Password required',
@@ -126,9 +125,7 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
id="username"
name="username"
type="text"
placeholder={`${intl.formatMessage(
messages.email
)} / ${intl.formatMessage(messages.username)}`}
placeholder={intl.formatMessage(messages.username)}
className="!bg-gray-700/80 placeholder:text-gray-400"
data-form-type="username"
/>

View File

@@ -15,7 +15,6 @@ import * as Yup from 'yup';
const messages = defineMessages('components.Settings.Notifications', {
agentenabled: 'Enable Agent',
embedPoster: 'Embed Poster',
botUsername: 'Bot Username',
botAvatarUrl: 'Bot Avatar URL',
webhookUrl: 'Webhook URL',
@@ -75,7 +74,6 @@ const NotificationsDiscord = () => {
<Formik
initialValues={{
enabled: data.enabled,
embedPoster: data.embedPoster,
types: data.types,
botUsername: data?.options.botUsername,
botAvatarUrl: data?.options.botAvatarUrl,
@@ -88,7 +86,6 @@ const NotificationsDiscord = () => {
try {
await axios.post('/api/v1/settings/notifications/discord', {
enabled: values.enabled,
embedPoster: values.embedPoster,
types: values.types,
options: {
botUsername: values.botUsername,
@@ -138,7 +135,6 @@ const NotificationsDiscord = () => {
);
await axios.post('/api/v1/settings/notifications/discord/test', {
enabled: true,
embedPoster: values.embedPoster,
types: values.types,
options: {
botUsername: values.botUsername,
@@ -180,14 +176,6 @@ const NotificationsDiscord = () => {
<Field type="checkbox" id="enabled" name="enabled" />
</div>
</div>
<div className="form-row">
<label htmlFor="embedPoster" className="checkbox-label">
{intl.formatMessage(messages.embedPoster)}
</label>
<div className="form-input-area">
<Field type="checkbox" id="embedPoster" name="embedPoster" />
</div>
</div>
<div className="form-row">
<label htmlFor="name" className="text-label">
{intl.formatMessage(messages.webhookUrl)}

View File

@@ -17,7 +17,6 @@ const messages = defineMessages('components.Settings.Notifications', {
validationSmtpHostRequired: 'You must provide a valid hostname or IP address',
validationSmtpPortRequired: 'You must provide a valid port number',
agentenabled: 'Enable Agent',
embedPoster: 'Embed Poster',
userEmailRequired: 'Require user email',
emailsender: 'Sender Address',
smtpHost: 'SMTP Host',
@@ -123,7 +122,6 @@ const NotificationsEmail = () => {
<Formik
initialValues={{
enabled: data.enabled,
embedPoster: data.embedPoster,
userEmailRequired: data.options.userEmailRequired,
emailFrom: data.options.emailFrom,
smtpHost: data.options.smtpHost,
@@ -147,7 +145,6 @@ const NotificationsEmail = () => {
try {
await axios.post('/api/v1/settings/notifications/email', {
enabled: values.enabled,
embedPoster: values.embedPoster,
options: {
userEmailRequired: values.userEmailRequired,
emailFrom: values.emailFrom,
@@ -197,7 +194,6 @@ const NotificationsEmail = () => {
);
await axios.post('/api/v1/settings/notifications/email/test', {
enabled: true,
embedPoster: values.embedPoster,
options: {
emailFrom: values.emailFrom,
smtpHost: values.smtpHost,
@@ -245,14 +241,6 @@ const NotificationsEmail = () => {
<Field type="checkbox" id="enabled" name="enabled" />
</div>
</div>
<div className="form-row">
<label htmlFor="embedPoster" className="checkbox-label">
{intl.formatMessage(messages.embedPoster)}
</label>
<div className="form-input-area">
<Field type="checkbox" id="embedPoster" name="embedPoster" />
</div>
</div>
<div className="form-row">
<label htmlFor="userEmailRequired" className="checkbox-label">
{intl.formatMessage(messages.userEmailRequired)}

View File

@@ -19,7 +19,6 @@ const messages = defineMessages(
'components.Settings.Notifications.NotificationsNtfy',
{
agentenabled: 'Enable Agent',
embedPoster: 'Embed Poster',
url: 'Server root URL',
topic: 'Topic',
usernamePasswordAuth: 'Username + Password authentication',
@@ -81,7 +80,6 @@ const NotificationsNtfy = () => {
<Formik
initialValues={{
enabled: data?.enabled,
embedPoster: data?.embedPoster,
types: data?.types,
url: data?.options.url,
topic: data?.options.topic,
@@ -96,7 +94,6 @@ const NotificationsNtfy = () => {
try {
await axios.post('/api/v1/settings/notifications/ntfy', {
enabled: values.enabled,
embedPoster: values.embedPoster,
types: values.types,
options: {
url: values.url,
@@ -191,14 +188,6 @@ const NotificationsNtfy = () => {
<Field type="checkbox" id="enabled" name="enabled" />
</div>
</div>
<div className="form-row">
<label htmlFor="embedPoster" className="checkbox-label">
{intl.formatMessage(messages.embedPoster)}
</label>
<div className="form-input-area">
<Field type="checkbox" id="embedPoster" name="embedPoster" />
</div>
</div>
<div className="form-row">
<label htmlFor="url" className="text-label">
{intl.formatMessage(messages.url)}

View File

@@ -17,7 +17,6 @@ const messages = defineMessages(
'components.Settings.Notifications.NotificationsPushover',
{
agentenabled: 'Enable Agent',
embedPoster: 'Embed Poster',
accessToken: 'Application API Token',
accessTokenTip:
'<ApplicationRegistrationLink>Register an application</ApplicationRegistrationLink> for use with Jellyseerr',
@@ -87,7 +86,6 @@ const NotificationsPushover = () => {
<Formik
initialValues={{
enabled: data?.enabled,
embedPoster: data?.embedPoster,
types: data?.types,
accessToken: data?.options.accessToken,
userToken: data?.options.userToken,
@@ -98,7 +96,6 @@ const NotificationsPushover = () => {
try {
await axios.post('/api/v1/settings/notifications/pushover', {
enabled: values.enabled,
embedPoster: values.embedPoster,
types: values.types,
options: {
accessToken: values.accessToken,
@@ -145,7 +142,6 @@ const NotificationsPushover = () => {
);
await axios.post('/api/v1/settings/notifications/pushover/test', {
enabled: true,
embedPoster: values.embedPoster,
types: values.types,
options: {
accessToken: values.accessToken,
@@ -185,14 +181,6 @@ const NotificationsPushover = () => {
<Field type="checkbox" id="enabled" name="enabled" />
</div>
</div>
<div className="form-row">
<label htmlFor="embedPoster" className="checkbox-label">
{intl.formatMessage(messages.embedPoster)}
</label>
<div className="form-input-area">
<Field type="checkbox" id="embedPoster" name="embedPoster" />
</div>
</div>
<div className="form-row">
<label htmlFor="accessToken" className="text-label">
{intl.formatMessage(messages.accessToken)}

View File

@@ -16,7 +16,6 @@ const messages = defineMessages(
'components.Settings.Notifications.NotificationsSlack',
{
agentenabled: 'Enable Agent',
embedPoster: 'Embed Poster',
webhookUrl: 'Webhook URL',
webhookUrlTip:
'Create an <WebhookLink>Incoming Webhook</WebhookLink> integration',
@@ -60,7 +59,6 @@ const NotificationsSlack = () => {
<Formik
initialValues={{
enabled: data.enabled,
embedPoster: data.embedPoster,
types: data.types,
webhookUrl: data.options.webhookUrl,
}}
@@ -69,7 +67,6 @@ const NotificationsSlack = () => {
try {
await axios.post('/api/v1/settings/notifications/slack', {
enabled: values.enabled,
embedPoster: values.embedPoster,
types: values.types,
options: {
webhookUrl: values.webhookUrl,
@@ -114,7 +111,6 @@ const NotificationsSlack = () => {
);
await axios.post('/api/v1/settings/notifications/slack/test', {
enabled: true,
embedPoster: values.embedPoster,
types: values.types,
options: {
webhookUrl: values.webhookUrl,
@@ -152,14 +148,6 @@ const NotificationsSlack = () => {
<Field type="checkbox" id="enabled" name="enabled" />
</div>
</div>
<div className="form-row">
<label htmlFor="embedPoster" className="checkbox-label">
{intl.formatMessage(messages.embedPoster)}
</label>
<div className="form-input-area">
<Field type="checkbox" id="embedPoster" name="embedPoster" />
</div>
</div>
<div className="form-row">
<label htmlFor="name" className="text-label">
{intl.formatMessage(messages.webhookUrl)}

View File

@@ -15,7 +15,6 @@ import * as Yup from 'yup';
const messages = defineMessages('components.Settings.Notifications', {
agentenabled: 'Enable Agent',
embedPoster: 'Embed Poster',
botUsername: 'Bot Username',
botUsernameTip:
'Allow users to also start a chat with your bot and configure their own notifications',
@@ -90,7 +89,6 @@ const NotificationsTelegram = () => {
<Formik
initialValues={{
enabled: data?.enabled,
embedPoster: data?.embedPoster,
types: data?.types,
botUsername: data?.options.botUsername,
botAPI: data?.options.botAPI,
@@ -103,7 +101,6 @@ const NotificationsTelegram = () => {
try {
await axios.post('/api/v1/settings/notifications/telegram', {
enabled: values.enabled,
embedPoster: values.embedPoster,
types: values.types,
options: {
botAPI: values.botAPI,
@@ -194,14 +191,6 @@ const NotificationsTelegram = () => {
<Field type="checkbox" id="enabled" name="enabled" />
</div>
</div>
<div className="form-row">
<label htmlFor="embedPoster" className="checkbox-label">
{intl.formatMessage(messages.embedPoster)}
</label>
<div className="form-input-area">
<Field type="checkbox" id="embedPoster" name="embedPoster" />
</div>
</div>
<div className="form-row">
<label htmlFor="botAPI" className="text-label">
{intl.formatMessage(messages.botAPI)}

View File

@@ -15,7 +15,6 @@ const messages = defineMessages(
'components.Settings.Notifications.NotificationsWebPush',
{
agentenabled: 'Enable Agent',
embedPoster: 'Embed Poster',
webpushsettingssaved: 'Web push notification settings saved successfully!',
webpushsettingsfailed: 'Web push notification settings failed to save.',
toastWebPushTestSending: 'Sending web push test notification…',
@@ -56,13 +55,11 @@ const NotificationsWebPush = () => {
<Formik
initialValues={{
enabled: data.enabled,
embedPoster: data.embedPoster,
}}
onSubmit={async (values) => {
try {
await axios.post('/api/v1/settings/notifications/webpush', {
enabled: values.enabled,
embedPoster: values.embedPoster,
options: {},
});
mutate('/api/v1/settings/public');
@@ -80,7 +77,7 @@ const NotificationsWebPush = () => {
}
}}
>
{({ isSubmitting, values }) => {
{({ isSubmitting }) => {
const testSettings = async () => {
setIsTesting(true);
let toastId: string | undefined;
@@ -97,7 +94,6 @@ const NotificationsWebPush = () => {
);
await axios.post('/api/v1/settings/notifications/webpush/test', {
enabled: true,
embedPoster: values.embedPoster,
options: {},
});
@@ -132,15 +128,6 @@ const NotificationsWebPush = () => {
<Field type="checkbox" id="enabled" name="enabled" />
</div>
</div>
<div className="form-row">
<label htmlFor="embedPoster" className="checkbox-label">
{intl.formatMessage(messages.embedPoster)}
<span className="label-required">*</span>
</label>
<div className="form-input-area">
<Field type="checkbox" id="embedPoster" name="embedPoster" />
</div>
</div>
<div className="actions">
<div className="flex justify-end">
<span className="ml-3 inline-flex rounded-md shadow-sm">

View File

@@ -1,7 +1,6 @@
import Button from '@app/components/Common/Button';
import LoadingSpinner from '@app/components/Common/LoadingSpinner';
import NotificationTypeSelector from '@app/components/NotificationTypeSelector';
import SettingsBadge from '@app/components/Settings/SettingsBadge';
import globalMessages from '@app/i18n/globalMessages';
import defineMessages from '@app/utils/defineMessages';
import { isValidURL } from '@app/utils/urlValidationHelper';
@@ -74,11 +73,6 @@ const messages = defineMessages(
{
agentenabled: 'Enable Agent',
webhookUrl: 'Webhook URL',
webhookUrlTip:
'Test Notification URL is set to {testUrl} instead of the actual webhook URL.',
supportVariables: 'Support URL Variables',
supportVariablesTip:
'Available variables are documented in the webhook template variables section',
authheader: 'Authorization Header',
validationJsonPayloadRequired: 'You must provide a valid JSON payload',
webhooksettingssaved: 'Webhook notification settings saved successfully!',
@@ -117,14 +111,8 @@ const NotificationsWebhook = () => {
.test(
'valid-url',
intl.formatMessage(messages.validationWebhookUrl),
function (value) {
const { supportVariables } = this.parent;
return supportVariables || isValidURL(value);
}
isValidURL
),
supportVariables: Yup.boolean(),
jsonPayload: Yup.string()
.when('enabled', {
is: true,
@@ -159,7 +147,6 @@ const NotificationsWebhook = () => {
webhookUrl: data.options.webhookUrl,
jsonPayload: data.options.jsonPayload,
authHeader: data.options.authHeader,
supportVariables: data.options.supportVariables ?? false,
}}
validationSchema={NotificationsWebhookSchema}
onSubmit={async (values) => {
@@ -171,7 +158,6 @@ const NotificationsWebhook = () => {
webhookUrl: values.webhookUrl,
jsonPayload: JSON.stringify(values.jsonPayload),
authHeader: values.authHeader,
supportVariables: values.supportVariables,
},
});
addToast(intl.formatMessage(messages.webhooksettingssaved), {
@@ -229,7 +215,6 @@ const NotificationsWebhook = () => {
webhookUrl: values.webhookUrl,
jsonPayload: JSON.stringify(values.jsonPayload),
authHeader: values.authHeader,
supportVariables: values.supportVariables ?? false,
},
});
@@ -264,59 +249,10 @@ const NotificationsWebhook = () => {
<Field type="checkbox" id="enabled" name="enabled" />
</div>
</div>
<div className="form-row">
<label htmlFor="supportVariables" className="checkbox-label">
<span className="mr-2">
{intl.formatMessage(messages.supportVariables)}
</span>
<SettingsBadge badgeType="experimental" />
<span className="label-tip">
{intl.formatMessage(messages.supportVariablesTip)}
</span>
</label>
<div className="form-input-area">
<Field
type="checkbox"
id="supportVariables"
name="supportVariables"
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
setFieldValue('supportVariables', e.target.checked)
}
/>
</div>
</div>
{values.supportVariables && (
<div className="mt-2">
<Link
href="https://docs.jellyseerr.dev/using-jellyseerr/notifications/webhook#template-variables"
passHref
legacyBehavior
>
<Button
as="a"
buttonSize="sm"
target="_blank"
rel="noreferrer"
>
<QuestionMarkCircleIcon />
<span>
{intl.formatMessage(messages.templatevariablehelp)}
</span>
</Button>
</Link>
</div>
)}
<div className="form-row">
<label htmlFor="webhookUrl" className="text-label">
{intl.formatMessage(messages.webhookUrl)}
<span className="label-required">*</span>
{values.supportVariables && (
<div className="label-tip">
{intl.formatMessage(messages.webhookUrlTip, {
testUrl: '/test',
})}
</div>
)}
</label>
<div className="form-input-area">
<div className="form-input-field">
@@ -376,7 +312,7 @@ const NotificationsWebhook = () => {
<span>{intl.formatMessage(messages.resetPayload)}</span>
</Button>
<Link
href="https://docs.jellyseerr.dev/using-jellyseerr/notifications/webhook#template-variables"
href="https://docs.overseerr.dev/using-overseerr/notifications/webhooks#template-variables"
passHref
legacyBehavior
>

View File

@@ -7,6 +7,7 @@ import LanguageSelector from '@app/components/LanguageSelector';
import RegionSelector from '@app/components/RegionSelector';
import CopyButton from '@app/components/Settings/CopyButton';
import SettingsBadge from '@app/components/Settings/SettingsBadge';
import type { AvailableLocale } from '@app/context/LanguageContext';
import { availableLanguages } from '@app/context/LanguageContext';
import useLocale from '@app/hooks/useLocale';
import { Permission, useUser } from '@app/hooks/useUser';
@@ -17,7 +18,6 @@ import { ArrowDownOnSquareIcon } from '@heroicons/react/24/outline';
import { ArrowPathIcon } from '@heroicons/react/24/solid';
import type { UserSettingsGeneralResponse } from '@server/interfaces/api/userSettingsInterfaces';
import type { MainSettings } from '@server/lib/settings';
import type { AvailableLocale } from '@server/types/languages';
import axios from 'axios';
import { Field, Form, Formik } from 'formik';
import { useIntl } from 'react-intl';

View File

@@ -126,7 +126,7 @@ const SettingsNetwork = () => {
proxy: {
enabled: values.proxyEnabled,
hostname: values.proxyHostname,
port: Number(values.proxyPort),
port: values.proxyPort,
useSsl: values.proxySsl,
user: values.proxyUser,
password: values.proxyPassword,

View File

@@ -5,6 +5,7 @@ import PageTitle from '@app/components/Common/PageTitle';
import LanguageSelector from '@app/components/LanguageSelector';
import QuotaSelector from '@app/components/QuotaSelector';
import RegionSelector from '@app/components/RegionSelector';
import type { AvailableLocale } from '@app/context/LanguageContext';
import { availableLanguages } from '@app/context/LanguageContext';
import useLocale from '@app/hooks/useLocale';
import useSettings from '@app/hooks/useSettings';
@@ -15,7 +16,6 @@ import defineMessages from '@app/utils/defineMessages';
import { ArrowDownOnSquareIcon } from '@heroicons/react/24/outline';
import { ApiErrorCode } from '@server/constants/error';
import type { UserSettingsGeneralResponse } from '@server/interfaces/api/userSettingsInterfaces';
import type { AvailableLocale } from '@server/types/languages';
import axios from 'axios';
import { Field, Form, Formik } from 'formik';
import { useRouter } from 'next/router';

View File

@@ -1,6 +1,41 @@
import { type AvailableLocale } from '@server/types/languages';
import React from 'react';
export type AvailableLocale =
| 'ar'
| 'bg'
| 'ca'
| 'cs'
| 'da'
| 'de'
| 'en'
| 'el'
| 'es'
| 'es-MX'
| 'fi'
| 'fr'
| 'hr'
| 'he'
| 'hi'
| 'hu'
| 'it'
| 'ja'
| 'ko'
| 'lt'
| 'nb-NO'
| 'nl'
| 'pl'
| 'pt-BR'
| 'pt-PT'
| 'ro'
| 'ru'
| 'sq'
| 'sr'
| 'sv'
| 'tr'
| 'uk'
| 'zh-CN'
| 'zh-TW';
type AvailableLanguageObject = Record<
string,
{ code: AvailableLocale; display: string }

View File

@@ -180,7 +180,6 @@
"components.IssueDetails.toaststatusupdated": "Issue status updated successfully!",
"components.IssueDetails.toaststatusupdatefailed": "Something went wrong while updating the issue status.",
"components.IssueDetails.unknownissuetype": "Unknown",
"components.IssueList.IssueItem.descriptionpreview": "Issue Description",
"components.IssueList.IssueItem.episodes": "{episodeCount, plural, one {Episode} other {Episodes}}",
"components.IssueList.IssueItem.issuestatus": "Status",
"components.IssueList.IssueItem.issuetype": "Type",
@@ -624,7 +623,6 @@
"components.Settings.Notifications.NotificationsGotify.validationUrlRequired": "You must provide a valid URL",
"components.Settings.Notifications.NotificationsGotify.validationUrlTrailingSlash": "URL must not end in a trailing slash",
"components.Settings.Notifications.NotificationsNtfy.agentenabled": "Enable Agent",
"components.Settings.Notifications.NotificationsNtfy.embedPoster": "Embed Poster",
"components.Settings.Notifications.NotificationsNtfy.ntfysettingsfailed": "Ntfy notification settings failed to save.",
"components.Settings.Notifications.NotificationsNtfy.ntfysettingssaved": "Ntfy notification settings saved successfully!",
"components.Settings.Notifications.NotificationsNtfy.password": "Password",
@@ -655,7 +653,6 @@
"components.Settings.Notifications.NotificationsPushover.accessTokenTip": "<ApplicationRegistrationLink>Register an application</ApplicationRegistrationLink> for use with Jellyseerr",
"components.Settings.Notifications.NotificationsPushover.agentenabled": "Enable Agent",
"components.Settings.Notifications.NotificationsPushover.deviceDefault": "Device Default",
"components.Settings.Notifications.NotificationsPushover.embedPoster": "Embed Poster",
"components.Settings.Notifications.NotificationsPushover.pushoversettingsfailed": "Pushover notification settings failed to save.",
"components.Settings.Notifications.NotificationsPushover.pushoversettingssaved": "Pushover notification settings saved successfully!",
"components.Settings.Notifications.NotificationsPushover.sound": "Notification Sound",
@@ -668,7 +665,6 @@
"components.Settings.Notifications.NotificationsPushover.validationTypes": "You must select at least one notification type",
"components.Settings.Notifications.NotificationsPushover.validationUserTokenRequired": "You must provide a valid user or group key",
"components.Settings.Notifications.NotificationsSlack.agentenabled": "Enable Agent",
"components.Settings.Notifications.NotificationsSlack.embedPoster": "Embed Poster",
"components.Settings.Notifications.NotificationsSlack.slacksettingsfailed": "Slack notification settings failed to save.",
"components.Settings.Notifications.NotificationsSlack.slacksettingssaved": "Slack notification settings saved successfully!",
"components.Settings.Notifications.NotificationsSlack.toastSlackTestFailed": "Slack test notification failed to send.",
@@ -683,8 +679,6 @@
"components.Settings.Notifications.NotificationsWebhook.customJson": "JSON Payload",
"components.Settings.Notifications.NotificationsWebhook.resetPayload": "Reset to Default",
"components.Settings.Notifications.NotificationsWebhook.resetPayloadSuccess": "JSON payload reset successfully!",
"components.Settings.Notifications.NotificationsWebhook.supportVariables": "Support URL Variables",
"components.Settings.Notifications.NotificationsWebhook.supportVariablesTip": "Available variables are documented in the webhook template variables section",
"components.Settings.Notifications.NotificationsWebhook.templatevariablehelp": "Template Variable Help",
"components.Settings.Notifications.NotificationsWebhook.toastWebhookTestFailed": "Webhook test notification failed to send.",
"components.Settings.Notifications.NotificationsWebhook.toastWebhookTestSending": "Sending webhook test notification…",
@@ -693,11 +687,9 @@
"components.Settings.Notifications.NotificationsWebhook.validationTypes": "You must select at least one notification type",
"components.Settings.Notifications.NotificationsWebhook.validationWebhookUrl": "You must provide a valid URL",
"components.Settings.Notifications.NotificationsWebhook.webhookUrl": "Webhook URL",
"components.Settings.Notifications.NotificationsWebhook.webhookUrlTip": "Test Notification URL is set to {testUrl} instead of the actual webhook URL.",
"components.Settings.Notifications.NotificationsWebhook.webhooksettingsfailed": "Webhook notification settings failed to save.",
"components.Settings.Notifications.NotificationsWebhook.webhooksettingssaved": "Webhook notification settings saved successfully!",
"components.Settings.Notifications.NotificationsWebPush.agentenabled": "Enable Agent",
"components.Settings.Notifications.NotificationsWebPush.embedPoster": "Embed Poster",
"components.Settings.Notifications.NotificationsWebPush.httpsRequirement": "In order to receive web push notifications, Jellyseerr must be served over HTTPS.",
"components.Settings.Notifications.NotificationsWebPush.toastWebPushTestFailed": "Web push test notification failed to send.",
"components.Settings.Notifications.NotificationsWebPush.toastWebPushTestSending": "Sending web push test notification…",
@@ -720,7 +712,6 @@
"components.Settings.Notifications.emailsender": "Sender Address",
"components.Settings.Notifications.emailsettingsfailed": "Email notification settings failed to save.",
"components.Settings.Notifications.emailsettingssaved": "Email notification settings saved successfully!",
"components.Settings.Notifications.embedPoster": "Embed Poster",
"components.Settings.Notifications.enableMentions": "Enable Mentions",
"components.Settings.Notifications.encryption": "Encryption Method",
"components.Settings.Notifications.encryptionDefault": "Use STARTTLS if available",
@@ -1166,7 +1157,6 @@
"components.Settings.menuServices": "Services",
"components.Settings.menuUsers": "Users",
"components.Settings.metadataProviderSelection": "Metadata Provider Selection",
"components.Settings.metadataProviderSettings": "Metadata Providers",
"components.Settings.metadataSettings": "Settings for metadata provider",
"components.Settings.metadataSettingsSaved": "Metadata provider settings saved",
"components.Settings.no": "No",

View File

@@ -6,6 +6,7 @@ import StatusChecker from '@app/components/StatusChecker';
import Toast from '@app/components/Toast';
import ToastContainer from '@app/components/ToastContainer';
import { InteractionProvider } from '@app/context/InteractionContext';
import type { AvailableLocale } from '@app/context/LanguageContext';
import { LanguageContext } from '@app/context/LanguageContext';
import { SettingsProvider } from '@app/context/SettingsContext';
import { UserContext } from '@app/context/UserContext';
@@ -15,7 +16,6 @@ import '@app/styles/globals.css';
import { polyfillIntl } from '@app/utils/polyfillIntl';
import { MediaServerType } from '@server/constants/server';
import type { PublicSettingsResponse } from '@server/interfaces/api/settingsInterfaces';
import type { AvailableLocale } from '@server/types/languages';
import axios from 'axios';
import type { AppInitialProps, AppProps } from 'next/app';
import App from 'next/app';