feat(ui): add emby as a mediaServerType to the import user button
Add emby as a mediaServerType to the import user button and replace any reference to Jellyfin with mediaServerName
This commit is contained in:
@@ -15,15 +15,15 @@ interface JellyfinImportProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
importfromJellyfin: 'Import Jellyfin Users',
|
importfromJellyfin: 'Import {mediaServerName} Users',
|
||||||
importfromJellyfinerror:
|
importfromJellyfinerror:
|
||||||
'Something went wrong while importing Jellyfin users.',
|
'Something went wrong while importing {mediaServerName} users.',
|
||||||
importedfromJellyfin:
|
importedfromJellyfin:
|
||||||
'<strong>{userCount}</strong> Jellyfin {userCount, plural, one {user} other {users}} imported successfully!',
|
'<strong>{userCount}</strong> {mediaServerName} {userCount, plural, one {user} other {users}} imported successfully!',
|
||||||
user: 'User',
|
user: 'User',
|
||||||
noJellyfinuserstoimport: 'There are no Jellyfin users to import.',
|
noJellyfinuserstoimport: 'There are no {mediaServerName} users to import.',
|
||||||
newJellyfinsigninenabled:
|
newJellyfinsigninenabled:
|
||||||
'The <strong>Enable New Jellyfin Sign-In</strong> setting is currently enabled. Jellyfin users with library access do not need to be imported in order to sign in.',
|
'The <strong>Enable New {mediaServerName} Sign-In</strong> setting is currently enabled. {mediaServerName} users with library access do not need to be imported in order to sign in.',
|
||||||
});
|
});
|
||||||
|
|
||||||
const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
||||||
@@ -66,6 +66,8 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
strong: function strong(msg) {
|
strong: function strong(msg) {
|
||||||
return <strong>{msg}</strong>;
|
return <strong>{msg}</strong>;
|
||||||
},
|
},
|
||||||
|
mediaServerName:
|
||||||
|
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
autoDismiss: true,
|
autoDismiss: true,
|
||||||
@@ -77,10 +79,16 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
onComplete();
|
onComplete();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
addToast(intl.formatMessage(messages.importfromJellyfinerror), {
|
addToast(
|
||||||
autoDismiss: true,
|
intl.formatMessage(messages.importfromJellyfinerror, {
|
||||||
appearance: 'error',
|
mediaServerName:
|
||||||
});
|
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
autoDismiss: true,
|
||||||
|
appearance: 'error',
|
||||||
|
}
|
||||||
|
);
|
||||||
} finally {
|
} finally {
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
}
|
}
|
||||||
@@ -110,7 +118,10 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
loading={!data && !error}
|
loading={!data && !error}
|
||||||
title={intl.formatMessage(messages.importfromJellyfin)}
|
title={intl.formatMessage(messages.importfromJellyfin, {
|
||||||
|
mediaServerName:
|
||||||
|
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||||
|
})}
|
||||||
iconSvg={<InboxInIcon />}
|
iconSvg={<InboxInIcon />}
|
||||||
onOk={() => {
|
onOk={() => {
|
||||||
importUsers();
|
importUsers();
|
||||||
@@ -126,6 +137,8 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
{settings.currentSettings.newPlexLogin && (
|
{settings.currentSettings.newPlexLogin && (
|
||||||
<Alert
|
<Alert
|
||||||
title={intl.formatMessage(messages.newJellyfinsigninenabled, {
|
title={intl.formatMessage(messages.newJellyfinsigninenabled, {
|
||||||
|
mediaServerName:
|
||||||
|
process.env.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>
|
||||||
@@ -240,7 +253,10 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Alert
|
<Alert
|
||||||
title={intl.formatMessage(messages.noJellyfinuserstoimport)}
|
title={intl.formatMessage(messages.noJellyfinuserstoimport, {
|
||||||
|
mediaServerName:
|
||||||
|
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||||
|
})}
|
||||||
type="info"
|
type="info"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -503,13 +503,18 @@ const UserList: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<InboxInIcon />
|
<InboxInIcon />
|
||||||
<span>
|
<span>
|
||||||
{intl.formatMessage(messages.importfromplex, {
|
{process.env.JELLYFIN_TYPE == 'emby'
|
||||||
mediaServerName:
|
? intl.formatMessage(messages.importfromplex, {
|
||||||
settings.currentSettings.mediaServerType ===
|
mediaServerName: 'Emby',
|
||||||
|
})
|
||||||
|
: settings.currentSettings.mediaServerType ===
|
||||||
MediaServerType.PLEX
|
MediaServerType.PLEX
|
||||||
? 'Plex'
|
? intl.formatMessage(messages.importfromplex, {
|
||||||
: 'Jellyfin',
|
mediaServerName: 'Plex',
|
||||||
})}
|
})
|
||||||
|
: intl.formatMessage(messages.importfromplex, {
|
||||||
|
mediaServerName: 'Jellyfin',
|
||||||
|
})}
|
||||||
</span>
|
</span>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user