fix(ui): fix ui elements not reflecting the env variable
Fix emby ui elements not reflecting the emby env variable set during runtime
This commit is contained in:
@@ -2,6 +2,10 @@ module.exports = {
|
|||||||
env: {
|
env: {
|
||||||
commitTag: process.env.COMMIT_TAG || 'local',
|
commitTag: process.env.COMMIT_TAG || 'local',
|
||||||
},
|
},
|
||||||
|
publicRuntimeConfig: {
|
||||||
|
// Will be available on both server and client
|
||||||
|
JELLYFIN_TYPE: process.env.JELLYFIN_TYPE,
|
||||||
|
},
|
||||||
images: {
|
images: {
|
||||||
domains: ['image.tmdb.org'],
|
domains: ['image.tmdb.org'],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import IssueComment from './IssueComment';
|
|||||||
import IssueDescription from './IssueDescription';
|
import IssueDescription from './IssueDescription';
|
||||||
import { MediaServerType } from '../../../server/constants/server';
|
import { MediaServerType } from '../../../server/constants/server';
|
||||||
import useSettings from '../../hooks/useSettings';
|
import useSettings from '../../hooks/useSettings';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
openedby: '#{issueId} opened {relativeTime} by {username}',
|
openedby: '#{issueId} opened {relativeTime} by {username}',
|
||||||
@@ -99,6 +100,7 @@ const IssueDetails: React.FC = () => {
|
|||||||
(opt) => opt.issueType === issueData?.issueType
|
(opt) => opt.issueType === issueData?.issueType
|
||||||
);
|
);
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
|
|
||||||
if (!data && !error) {
|
if (!data && !error) {
|
||||||
return <LoadingSpinner />;
|
return <LoadingSpinner />;
|
||||||
@@ -366,7 +368,7 @@ const IssueDetails: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<PlayIcon />
|
<PlayIcon />
|
||||||
<span>
|
<span>
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.playonplex, {
|
? intl.formatMessage(messages.playonplex, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
@@ -412,7 +414,7 @@ const IssueDetails: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<PlayIcon />
|
<PlayIcon />
|
||||||
<span>
|
<span>
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.play4konplex, {
|
? intl.formatMessage(messages.play4konplex, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
@@ -628,7 +630,7 @@ const IssueDetails: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<PlayIcon />
|
<PlayIcon />
|
||||||
<span>
|
<span>
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.playonplex, {
|
? intl.formatMessage(messages.playonplex, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
@@ -674,7 +676,7 @@ const IssueDetails: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<PlayIcon />
|
<PlayIcon />
|
||||||
<span>
|
<span>
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.play4konplex, {
|
? intl.formatMessage(messages.play4konplex, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { useToasts } from 'react-toast-notifications';
|
|||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import useSettings from '../../hooks/useSettings';
|
import useSettings from '../../hooks/useSettings';
|
||||||
import Button from '../Common/Button';
|
import Button from '../Common/Button';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
username: 'Username',
|
username: 'Username',
|
||||||
@@ -39,21 +40,19 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
|
|||||||
const toasts = useToasts();
|
const toasts = useToasts();
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
|
|
||||||
if (initial) {
|
if (initial) {
|
||||||
const LoginSchema = Yup.object().shape({
|
const LoginSchema = Yup.object().shape({
|
||||||
host: Yup.string()
|
host: Yup.string()
|
||||||
.matches(
|
.matches(
|
||||||
/^(?:(?:(?:https?):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/,
|
/^(?:(?:(?:https?):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/,
|
||||||
intl.formatMessage(messages.validationhostformat, {
|
intl.formatMessage(messages.validationhostformat)
|
||||||
mediaServerName:
|
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
|
||||||
})
|
|
||||||
)
|
)
|
||||||
.required(
|
.required(
|
||||||
intl.formatMessage(messages.validationhostrequired, {
|
intl.formatMessage(messages.validationhostrequired, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
email: Yup.string()
|
email: Yup.string()
|
||||||
@@ -104,7 +103,9 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
|
|||||||
<label htmlFor="host" className="text-label">
|
<label htmlFor="host" className="text-label">
|
||||||
{intl.formatMessage(messages.host, {
|
{intl.formatMessage(messages.host, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
|
? 'Emby'
|
||||||
|
: 'Jellyfin',
|
||||||
})}
|
})}
|
||||||
</label>
|
</label>
|
||||||
<div className="mt-1 mb-2 sm:col-span-2 sm:mt-0">
|
<div className="mt-1 mb-2 sm:col-span-2 sm:mt-0">
|
||||||
@@ -115,7 +116,7 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
|
|||||||
type="text"
|
type="text"
|
||||||
placeholder={intl.formatMessage(messages.host, {
|
placeholder={intl.formatMessage(messages.host, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby'
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? 'Emby'
|
? 'Emby'
|
||||||
: 'Jellyfin',
|
: 'Jellyfin',
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import PersonCard from '../PersonCard';
|
|||||||
import RequestButton from '../RequestButton';
|
import RequestButton from '../RequestButton';
|
||||||
import Slider from '../Slider';
|
import Slider from '../Slider';
|
||||||
import StatusBadge from '../StatusBadge';
|
import StatusBadge from '../StatusBadge';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
originaltitle: 'Original Title',
|
originaltitle: 'Original Title',
|
||||||
@@ -95,6 +96,7 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
|||||||
const minStudios = 3;
|
const minStudios = 3;
|
||||||
const [showMoreStudios, setShowMoreStudios] = useState(false);
|
const [showMoreStudios, setShowMoreStudios] = useState(false);
|
||||||
const [showIssueModal, setShowIssueModal] = useState(false);
|
const [showIssueModal, setShowIssueModal] = useState(false);
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data,
|
data,
|
||||||
@@ -223,7 +225,7 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
|||||||
?.flatrate ?? [];
|
?.flatrate ?? [];
|
||||||
|
|
||||||
function getAvalaibleMediaServerName() {
|
function getAvalaibleMediaServerName() {
|
||||||
if (process.env.JELLYFIN_TYPE === 'emby') {
|
if (publicRuntimeConfig.JELLYFIN_TYPE === 'emby') {
|
||||||
return intl.formatMessage(messages.play, { mediaServerName: 'Emby' });
|
return intl.formatMessage(messages.play, { mediaServerName: 'Emby' });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +237,7 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getAvalaible4kMediaServerName() {
|
function getAvalaible4kMediaServerName() {
|
||||||
if (process.env.JELLYFIN_TYPE === 'emby') {
|
if (publicRuntimeConfig.JELLYFIN_TYPE === 'emby') {
|
||||||
return intl.formatMessage(messages.play4k, { mediaServerName: 'Emby' });
|
return intl.formatMessage(messages.play4k, { mediaServerName: 'Emby' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import Badge from '../Common/Badge';
|
|||||||
import Button from '../Common/Button';
|
import Button from '../Common/Button';
|
||||||
import LoadingSpinner from '../Common/LoadingSpinner';
|
import LoadingSpinner from '../Common/LoadingSpinner';
|
||||||
import LibraryItem from './LibraryItem';
|
import LibraryItem from './LibraryItem';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
jellyfinsettings: '{mediaServerName} Settings',
|
jellyfinsettings: '{mediaServerName} Settings',
|
||||||
@@ -80,6 +81,7 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
|
|||||||
);
|
);
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const { addToast } = useToasts();
|
const { addToast } = useToasts();
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
|
|
||||||
const JellyfinSettingsSchema = Yup.object().shape({
|
const JellyfinSettingsSchema = Yup.object().shape({
|
||||||
jellyfinExternalUrl: Yup.string().matches(
|
jellyfinExternalUrl: Yup.string().matches(
|
||||||
@@ -161,7 +163,7 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
|
|||||||
<>
|
<>
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<h3 className="heading">
|
<h3 className="heading">
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.jellyfinlibraries, {
|
? intl.formatMessage(messages.jellyfinlibraries, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
@@ -170,7 +172,7 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
|
|||||||
})}
|
})}
|
||||||
</h3>
|
</h3>
|
||||||
<p className="description">
|
<p className="description">
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.jellyfinlibrariesDescription, {
|
? intl.formatMessage(messages.jellyfinlibrariesDescription, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
@@ -213,7 +215,7 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
|
|||||||
<FormattedMessage {...messages.manualscanJellyfin} />
|
<FormattedMessage {...messages.manualscanJellyfin} />
|
||||||
</h3>
|
</h3>
|
||||||
<p className="description">
|
<p className="description">
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.manualscanDescriptionJellyfin, {
|
? intl.formatMessage(messages.manualscanDescriptionJellyfin, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
@@ -323,7 +325,7 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
|
|||||||
<>
|
<>
|
||||||
<div className="mt-10 mb-6">
|
<div className="mt-10 mb-6">
|
||||||
<h3 className="heading">
|
<h3 className="heading">
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.jellyfinSettings, {
|
? intl.formatMessage(messages.jellyfinSettings, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
@@ -332,7 +334,7 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
|
|||||||
})}
|
})}
|
||||||
</h3>
|
</h3>
|
||||||
<p className="description">
|
<p className="description">
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.jellyfinSettingsDescription, {
|
? intl.formatMessage(messages.jellyfinSettingsDescription, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
@@ -355,7 +357,9 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
|
|||||||
addToast(
|
addToast(
|
||||||
intl.formatMessage(messages.jellyfinSettingsSuccess, {
|
intl.formatMessage(messages.jellyfinSettingsSuccess, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
|
? 'Emby'
|
||||||
|
: 'Jellyfin',
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
autoDismiss: true,
|
autoDismiss: true,
|
||||||
@@ -366,7 +370,9 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
|
|||||||
addToast(
|
addToast(
|
||||||
intl.formatMessage(messages.jellyfinSettingsFailure, {
|
intl.formatMessage(messages.jellyfinSettingsFailure, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
|
? 'Emby'
|
||||||
|
: 'Jellyfin',
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
autoDismiss: true,
|
autoDismiss: true,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { defineMessages, useIntl } from 'react-intl';
|
|||||||
import globalMessages from '../../i18n/globalMessages';
|
import globalMessages from '../../i18n/globalMessages';
|
||||||
import PageTitle from '../Common/PageTitle';
|
import PageTitle from '../Common/PageTitle';
|
||||||
import SettingsTabs, { SettingsRoute } from '../Common/SettingsTabs';
|
import SettingsTabs, { SettingsRoute } from '../Common/SettingsTabs';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
menuGeneralSettings: 'General',
|
menuGeneralSettings: 'General',
|
||||||
@@ -18,6 +19,7 @@ const messages = defineMessages({
|
|||||||
|
|
||||||
const SettingsLayout: React.FC = ({ children }) => {
|
const SettingsLayout: React.FC = ({ children }) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
const settingsRoutes: SettingsRoute[] = [
|
const settingsRoutes: SettingsRoute[] = [
|
||||||
{
|
{
|
||||||
text: intl.formatMessage(messages.menuGeneralSettings),
|
text: intl.formatMessage(messages.menuGeneralSettings),
|
||||||
@@ -76,7 +78,7 @@ const SettingsLayout: React.FC = ({ children }) => {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
function getAvalaibleMediaServerName() {
|
function getAvalaibleMediaServerName() {
|
||||||
if (process.env.JELLYFIN_TYPE === 'emby') {
|
if (publicRuntimeConfig.JELLYFIN_TYPE === 'emby') {
|
||||||
return intl.formatMessage(messages.menuJellyfinSettings, {
|
return intl.formatMessage(messages.menuJellyfinSettings, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import LoadingSpinner from '../../Common/LoadingSpinner';
|
|||||||
import PageTitle from '../../Common/PageTitle';
|
import PageTitle from '../../Common/PageTitle';
|
||||||
import PermissionEdit from '../../PermissionEdit';
|
import PermissionEdit from '../../PermissionEdit';
|
||||||
import QuotaSelector from '../../QuotaSelector';
|
import QuotaSelector from '../../QuotaSelector';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
users: 'Users',
|
users: 'Users',
|
||||||
@@ -42,6 +43,7 @@ const SettingsUsers: React.FC = () => {
|
|||||||
mutate: revalidate,
|
mutate: revalidate,
|
||||||
} = useSWR<MainSettings>('/api/v1/settings/main');
|
} = useSWR<MainSettings>('/api/v1/settings/main');
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
|
|
||||||
if (!data && !error) {
|
if (!data && !error) {
|
||||||
return <LoadingSpinner />;
|
return <LoadingSpinner />;
|
||||||
@@ -131,7 +133,7 @@ const SettingsUsers: React.FC = () => {
|
|||||||
<label htmlFor="newPlexLogin" className="checkbox-label">
|
<label htmlFor="newPlexLogin" className="checkbox-label">
|
||||||
{intl.formatMessage(messages.newPlexLogin, {
|
{intl.formatMessage(messages.newPlexLogin, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby'
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? 'Emby'
|
? 'Emby'
|
||||||
: settings.currentSettings.mediaServerType ===
|
: settings.currentSettings.mediaServerType ===
|
||||||
MediaServerType.PLEX
|
MediaServerType.PLEX
|
||||||
@@ -141,7 +143,7 @@ const SettingsUsers: React.FC = () => {
|
|||||||
<span className="label-tip">
|
<span className="label-tip">
|
||||||
{intl.formatMessage(messages.newPlexLoginTip, {
|
{intl.formatMessage(messages.newPlexLoginTip, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby'
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? 'Emby'
|
? 'Emby'
|
||||||
: settings.currentSettings.mediaServerType ===
|
: settings.currentSettings.mediaServerType ===
|
||||||
MediaServerType.PLEX
|
MediaServerType.PLEX
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import axios from 'axios';
|
|||||||
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
||||||
import Accordion from '../Common/Accordion';
|
import Accordion from '../Common/Accordion';
|
||||||
import { MediaServerType } from '../../../server/constants/server';
|
import { MediaServerType } from '../../../server/constants/server';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
welcome: 'Welcome to Overseerr',
|
welcome: 'Welcome to Overseerr',
|
||||||
@@ -25,6 +26,7 @@ const SetupLogin: React.FC<LoginWithMediaServerProps> = ({ onComplete }) => {
|
|||||||
);
|
);
|
||||||
const { user, revalidate } = useUser();
|
const { user, revalidate } = useUser();
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
// Effect that is triggered when the `authToken` comes back from the Plex OAuth
|
// Effect that is triggered when the `authToken` comes back from the Plex OAuth
|
||||||
// We take the token and attempt to login. If we get a success message, we will
|
// We take the token and attempt to login. If we get a success message, we will
|
||||||
// ask swr to revalidate the user which _shouid_ come back with a valid user.
|
// ask swr to revalidate the user which _shouid_ come back with a valid user.
|
||||||
@@ -91,7 +93,7 @@ const SetupLogin: React.FC<LoginWithMediaServerProps> = ({ onComplete }) => {
|
|||||||
}`}
|
}`}
|
||||||
onClick={() => handleClick(1)}
|
onClick={() => handleClick(1)}
|
||||||
>
|
>
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.signinWithJellyfin, {
|
? intl.formatMessage(messages.signinWithJellyfin, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import RequestButton from '../RequestButton';
|
|||||||
import RequestModal from '../RequestModal';
|
import RequestModal from '../RequestModal';
|
||||||
import Slider from '../Slider';
|
import Slider from '../Slider';
|
||||||
import StatusBadge from '../StatusBadge';
|
import StatusBadge from '../StatusBadge';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
firstAirDate: 'First Air Date',
|
firstAirDate: 'First Air Date',
|
||||||
@@ -85,6 +86,7 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
|
|||||||
router.query.manage == '1' ? true : false
|
router.query.manage == '1' ? true : false
|
||||||
);
|
);
|
||||||
const [showIssueModal, setShowIssueModal] = useState(false);
|
const [showIssueModal, setShowIssueModal] = useState(false);
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data,
|
data,
|
||||||
@@ -223,7 +225,7 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
|
|||||||
?.flatrate ?? [];
|
?.flatrate ?? [];
|
||||||
|
|
||||||
function getAvalaibleMediaServerName() {
|
function getAvalaibleMediaServerName() {
|
||||||
if (process.env.JELLYFIN_TYPE === 'emby') {
|
if (publicRuntimeConfig.JELLYFIN_TYPE === 'emby') {
|
||||||
return intl.formatMessage(messages.play, { mediaServerName: 'Emby' });
|
return intl.formatMessage(messages.play, { mediaServerName: 'Emby' });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +237,7 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getAvalaible4kMediaServerName() {
|
function getAvalaible4kMediaServerName() {
|
||||||
if (process.env.JELLYFIN_TYPE === 'emby') {
|
if (publicRuntimeConfig.JELLYFIN_TYPE === 'emby') {
|
||||||
return intl.formatMessage(messages.play4k, { mediaServerName: 'Emby' });
|
return intl.formatMessage(messages.play4k, { mediaServerName: 'Emby' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import useSettings from '../../hooks/useSettings';
|
|||||||
import globalMessages from '../../i18n/globalMessages';
|
import globalMessages from '../../i18n/globalMessages';
|
||||||
import Alert from '../Common/Alert';
|
import Alert from '../Common/Alert';
|
||||||
import Modal from '../Common/Modal';
|
import Modal from '../Common/Modal';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
interface JellyfinImportProps {
|
interface JellyfinImportProps {
|
||||||
onCancel?: () => void;
|
onCancel?: () => void;
|
||||||
@@ -32,6 +33,7 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
const { addToast } = useToasts();
|
const { addToast } = useToasts();
|
||||||
const [isImporting, setImporting] = useState(false);
|
const [isImporting, setImporting] = useState(false);
|
||||||
const [selectedUsers, setSelectedUsers] = useState<string[]>([]);
|
const [selectedUsers, setSelectedUsers] = useState<string[]>([]);
|
||||||
@@ -67,7 +69,7 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
return <strong>{msg}</strong>;
|
return <strong>{msg}</strong>;
|
||||||
},
|
},
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
autoDismiss: true,
|
autoDismiss: true,
|
||||||
@@ -82,7 +84,7 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
addToast(
|
addToast(
|
||||||
intl.formatMessage(messages.importfromJellyfinerror, {
|
intl.formatMessage(messages.importfromJellyfinerror, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
autoDismiss: true,
|
autoDismiss: true,
|
||||||
@@ -120,7 +122,7 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
loading={!data && !error}
|
loading={!data && !error}
|
||||||
title={intl.formatMessage(messages.importfromJellyfin, {
|
title={intl.formatMessage(messages.importfromJellyfin, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||||
})}
|
})}
|
||||||
iconSvg={<InboxInIcon />}
|
iconSvg={<InboxInIcon />}
|
||||||
onOk={() => {
|
onOk={() => {
|
||||||
@@ -138,7 +140,9 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
<Alert
|
<Alert
|
||||||
title={intl.formatMessage(messages.newJellyfinsigninenabled, {
|
title={intl.formatMessage(messages.newJellyfinsigninenabled, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
|
? 'Emby'
|
||||||
|
: 'Jellyfin',
|
||||||
strong: function strong(msg) {
|
strong: function strong(msg) {
|
||||||
return (
|
return (
|
||||||
<strong className="font-semibold text-white">{msg}</strong>
|
<strong className="font-semibold text-white">{msg}</strong>
|
||||||
@@ -255,7 +259,7 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
<Alert
|
<Alert
|
||||||
title={intl.formatMessage(messages.noJellyfinuserstoimport, {
|
title={intl.formatMessage(messages.noJellyfinuserstoimport, {
|
||||||
mediaServerName:
|
mediaServerName:
|
||||||
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
publicRuntimeConfig.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||||
})}
|
})}
|
||||||
type="info"
|
type="info"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import Transition from '../Transition';
|
|||||||
import BulkEditModal from './BulkEditModal';
|
import BulkEditModal from './BulkEditModal';
|
||||||
import JellyfinImportModal from './JellyfinImportModal';
|
import JellyfinImportModal from './JellyfinImportModal';
|
||||||
import PlexImportModal from './PlexImportModal';
|
import PlexImportModal from './PlexImportModal';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
users: 'Users',
|
users: 'Users',
|
||||||
@@ -87,6 +88,7 @@ const UserList: React.FC = () => {
|
|||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
const { addToast } = useToasts();
|
const { addToast } = useToasts();
|
||||||
const { user: currentUser, hasPermission: currentHasPermission } = useUser();
|
const { user: currentUser, hasPermission: currentHasPermission } = useUser();
|
||||||
const [currentSort, setCurrentSort] = useState<Sort>('displayname');
|
const [currentSort, setCurrentSort] = useState<Sort>('displayname');
|
||||||
@@ -503,7 +505,7 @@ const UserList: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<InboxInIcon />
|
<InboxInIcon />
|
||||||
<span>
|
<span>
|
||||||
{process.env.JELLYFIN_TYPE == 'emby'
|
{publicRuntimeConfig.JELLYFIN_TYPE == 'emby'
|
||||||
? intl.formatMessage(messages.importfromplex, {
|
? intl.formatMessage(messages.importfromplex, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
})
|
})
|
||||||
@@ -645,7 +647,7 @@ const UserList: React.FC = () => {
|
|||||||
<Badge badgeType="default">
|
<Badge badgeType="default">
|
||||||
{intl.formatMessage(messages.localuser)}
|
{intl.formatMessage(messages.localuser)}
|
||||||
</Badge>
|
</Badge>
|
||||||
) : process.env.JELLYFIN_TYPE == 'emby' ? (
|
) : publicRuntimeConfig.JELLYFIN_TYPE == 'emby' ? (
|
||||||
<Badge badgeType="success">
|
<Badge badgeType="success">
|
||||||
{intl.formatMessage(messages.mediaServerUser, {
|
{intl.formatMessage(messages.mediaServerUser, {
|
||||||
mediaServerName: 'Emby',
|
mediaServerName: 'Emby',
|
||||||
|
|||||||
Reference in New Issue
Block a user