mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-06 22:58:09 -05:00
feat(rebase): rebase
This commit is contained in:
@@ -129,7 +129,7 @@ components:
|
|||||||
example: true
|
example: true
|
||||||
mediaServerType:
|
mediaServerType:
|
||||||
type: number
|
type: number
|
||||||
example: 'PLEX | JELLYFIN'
|
example: 1
|
||||||
defaultPermissions:
|
defaultPermissions:
|
||||||
type: number
|
type: number
|
||||||
example: 32
|
example: 32
|
||||||
|
|||||||
@@ -197,7 +197,11 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update the users avatar with their jellyfin profile pic (incase it changed)
|
// Update the users avatar with their jellyfin profile pic (incase it changed)
|
||||||
user.avatar = `${hostname}/Users/${account.User.Id}/Images/Primary/?tag=${account.User.PrimaryImageTag}&quality=90`;
|
if (typeof account.User.PrimaryImageTag !== undefined) {
|
||||||
|
user.avatar = `${hostname}/Users/${account.User.Id}/Images/Primary/?tag=${account.User.PrimaryImageTag}&quality=90`;
|
||||||
|
} else {
|
||||||
|
user.avatar = '/images/os_logo_square.png';
|
||||||
|
}
|
||||||
user.email = account.User.Name;
|
user.email = account.User.Name;
|
||||||
user.jellyfinUsername = account.User.Name;
|
user.jellyfinUsername = account.User.Name;
|
||||||
|
|
||||||
@@ -217,7 +221,10 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
|
|||||||
jellyfinId: account.User.Id,
|
jellyfinId: account.User.Id,
|
||||||
jellyfinAuthToken: account.AccessToken,
|
jellyfinAuthToken: account.AccessToken,
|
||||||
permissions: Permission.ADMIN,
|
permissions: Permission.ADMIN,
|
||||||
avatar: `${hostname}/Users/${account.User.Id}/Images/Primary/?tag=${account.User.PrimaryImageTag}&quality=90`,
|
avatar:
|
||||||
|
typeof account.User.PrimaryImageTag !== undefined
|
||||||
|
? `${hostname}/Users/${account.User.Id}/Images/Primary/?tag=${account.User.PrimaryImageTag}&quality=90`
|
||||||
|
: '/images/os_logo_square.png',
|
||||||
userType: UserType.JELLYFIN,
|
userType: UserType.JELLYFIN,
|
||||||
});
|
});
|
||||||
await userRepository.save(user);
|
await userRepository.save(user);
|
||||||
|
|||||||
@@ -260,8 +260,6 @@ settingsRoutes.get('/jellyfin/library', async (req, res) => {
|
|||||||
const newLibraries: Library[] = libraries
|
const newLibraries: Library[] = libraries
|
||||||
// Remove libraries that are not movie or show
|
// Remove libraries that are not movie or show
|
||||||
.filter((library) => library.type === 'movie' || library.type === 'show')
|
.filter((library) => library.type === 'movie' || library.type === 'show')
|
||||||
// Remove libraries that do not have a metadata agent set (usually personal video libraries)
|
|
||||||
.filter((library) => library.agent !== 'com.plexapp.agents.none')
|
|
||||||
.map((library) => {
|
.map((library) => {
|
||||||
const existing = settings.plex.libraries.find(
|
const existing = settings.plex.libraries.find(
|
||||||
(l) => l.id === library.key && l.name === library.title
|
(l) => l.id === library.key && l.name === library.title
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
|||||||
settings.currentSettings.mediaServerType ===
|
settings.currentSettings.mediaServerType ===
|
||||||
MediaServerType.PLEX
|
MediaServerType.PLEX
|
||||||
? 'Plex'
|
? 'Plex'
|
||||||
: settings.currentSettings.jellyfinServerName,
|
: 'Jellyfin',
|
||||||
})
|
})
|
||||||
: data.mediaInfo?.mediaUrl4k &&
|
: data.mediaInfo?.mediaUrl4k &&
|
||||||
(hasPermission(Permission.REQUEST_4K) ||
|
(hasPermission(Permission.REQUEST_4K) ||
|
||||||
@@ -500,7 +500,7 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
|||||||
settings.currentSettings.mediaServerType ===
|
settings.currentSettings.mediaServerType ===
|
||||||
MediaServerType.PLEX
|
MediaServerType.PLEX
|
||||||
? 'Plex'
|
? 'Plex'
|
||||||
: settings.currentSettings.jellyfinServerName,
|
: 'Jellyfin',
|
||||||
})
|
})
|
||||||
: intl.formatMessage(messages.watchtrailer)}
|
: intl.formatMessage(messages.watchtrailer)}
|
||||||
</span>
|
</span>
|
||||||
@@ -543,7 +543,7 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
|||||||
settings.currentSettings.mediaServerType ===
|
settings.currentSettings.mediaServerType ===
|
||||||
MediaServerType.PLEX
|
MediaServerType.PLEX
|
||||||
? 'Plex'
|
? 'Plex'
|
||||||
: settings.currentSettings.jellyfinServerName,
|
: 'Jellyfin',
|
||||||
})}
|
})}
|
||||||
</ButtonWithDropdown.Item>
|
</ButtonWithDropdown.Item>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ import PlexLoginButton from '../PlexLoginButton';
|
|||||||
import JellyfinLogin from '../Login/JellyfinLogin';
|
import JellyfinLogin from '../Login/JellyfinLogin';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { defineMessages, FormattedMessage } from 'react-intl';
|
import { defineMessages, FormattedMessage } from 'react-intl';
|
||||||
import LoadingSpinner from '../Common/LoadingSpinner';
|
import Accordion from '../Common/Accordion';
|
||||||
|
import { MediaServerType } from '../../../server/constants/server';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
welcome: 'Welcome to Overseerr',
|
welcome: 'Welcome to Overseerr',
|
||||||
signinMessage: 'Get started by logging in with an account',
|
signinMessage: 'Get started by signing in',
|
||||||
signinWithJellyfin: 'Use Jellyfin',
|
signinWithJellyfin: 'Use your Jellyfin account',
|
||||||
|
signinWithPlex: 'Use your Plex account',
|
||||||
});
|
});
|
||||||
|
|
||||||
interface LoginWithMediaServerProps {
|
interface LoginWithMediaServerProps {
|
||||||
@@ -18,7 +20,9 @@ interface LoginWithMediaServerProps {
|
|||||||
|
|
||||||
const SetupLogin: React.FC<LoginWithMediaServerProps> = ({ onComplete }) => {
|
const SetupLogin: React.FC<LoginWithMediaServerProps> = ({ onComplete }) => {
|
||||||
const [authToken, setAuthToken] = useState<string | undefined>(undefined);
|
const [authToken, setAuthToken] = useState<string | undefined>(undefined);
|
||||||
const [mediaServerType, setMediaServerType] = useState<string>('');
|
const [mediaServerType, setMediaServerType] = useState<number>(
|
||||||
|
MediaServerType.NOT_CONFIGURED
|
||||||
|
);
|
||||||
const { user, revalidate } = useUser();
|
const { user, revalidate } = useUser();
|
||||||
|
|
||||||
// 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
|
||||||
@@ -35,7 +39,7 @@ const SetupLogin: React.FC<LoginWithMediaServerProps> = ({ onComplete }) => {
|
|||||||
revalidate();
|
revalidate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (authToken && mediaServerType == 'PLEX') {
|
if (authToken && mediaServerType == MediaServerType.PLEX) {
|
||||||
login();
|
login();
|
||||||
}
|
}
|
||||||
}, [authToken, mediaServerType, revalidate]);
|
}, [authToken, mediaServerType, revalidate]);
|
||||||
@@ -48,40 +52,59 @@ const SetupLogin: React.FC<LoginWithMediaServerProps> = ({ onComplete }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{mediaServerType == '' ? (
|
<div className="flex justify-center mb-2 text-xl font-bold">
|
||||||
<React.Fragment>
|
<FormattedMessage {...messages.welcome} />
|
||||||
<div className="flex justify-center mb-2 text-xl font-bold">
|
</div>
|
||||||
<FormattedMessage {...messages.welcome} />
|
<div className="flex justify-center pb-6 mb-2 text-sm">
|
||||||
</div>
|
<FormattedMessage {...messages.signinMessage} />
|
||||||
<div className="flex justify-center pb-6 mb-2 text-sm">
|
</div>
|
||||||
<FormattedMessage {...messages.signinMessage} />
|
<Accordion single atLeastOne>
|
||||||
</div>
|
{({ openIndexes, handleClick, AccordionContent }) => (
|
||||||
<div className="flex items-center justify-center pb-4">
|
<>
|
||||||
<PlexLoginButton
|
|
||||||
onAuthToken={(authToken) => {
|
|
||||||
setMediaServerType('PLEX');
|
|
||||||
setAuthToken(authToken);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<hr className="m-auto border-gray-600 w-60"></hr>
|
|
||||||
<span className="block w-full rounded-md shadow-sm">
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
className={`w-full py-2 text-sm text-center hover:bg-gray-700 hover:cursor-pointer text-gray-400 transition-colors duration-200 bg-gray-800 cursor-default focus:outline-none sm:rounded-t-lg ${
|
||||||
onClick={() => {
|
openIndexes.includes(0) && 'text-indigo-500'
|
||||||
setMediaServerType('JELLYFIN');
|
}`}
|
||||||
}}
|
onClick={() => handleClick(0)}
|
||||||
className="jellyfin-button"
|
|
||||||
>
|
>
|
||||||
<FormattedMessage {...messages.signinWithJellyfin} />
|
<FormattedMessage {...messages.signinWithPlex} />
|
||||||
</button>
|
</button>
|
||||||
</span>
|
<AccordionContent
|
||||||
</React.Fragment>
|
className="bg-opacity-90"
|
||||||
) : mediaServerType == 'JELLYFIN' ? (
|
isOpen={openIndexes.includes(0)}
|
||||||
<JellyfinLogin initial={true} revalidate={revalidate} />
|
>
|
||||||
) : (
|
<div className="px-10 py-8">
|
||||||
<LoadingSpinner></LoadingSpinner>
|
<PlexLoginButton
|
||||||
)}
|
onAuthToken={(authToken) => {
|
||||||
|
setMediaServerType(MediaServerType.PLEX);
|
||||||
|
setAuthToken(authToken);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</AccordionContent>
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
className={`w-full py-2 text-sm text-center text-gray-400 transition-colors duration-200 bg-gray-800 cursor-default focus:outline-none hover:bg-gray-700 hover:cursor-pointer ${
|
||||||
|
openIndexes.includes(1)
|
||||||
|
? 'text-indigo-500'
|
||||||
|
: 'sm:rounded-b-lg'
|
||||||
|
}`}
|
||||||
|
onClick={() => handleClick(1)}
|
||||||
|
>
|
||||||
|
<FormattedMessage {...messages.signinWithJellyfin} />
|
||||||
|
</button>
|
||||||
|
<AccordionContent
|
||||||
|
className="bg-opacity-90"
|
||||||
|
isOpen={openIndexes.includes(1)}
|
||||||
|
>
|
||||||
|
<div className="px-10 py-8">
|
||||||
|
<JellyfinLogin initial={true} revalidate={revalidate} />
|
||||||
|
</div>
|
||||||
|
</AccordionContent>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Accordion>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -599,6 +599,7 @@
|
|||||||
"components.Setup.signin": "Sign In",
|
"components.Setup.signin": "Sign In",
|
||||||
"components.Setup.signinMessage": "Get started by signing in",
|
"components.Setup.signinMessage": "Get started by signing in",
|
||||||
"components.Setup.signinWithJellyfin": "Use Jellyfin",
|
"components.Setup.signinWithJellyfin": "Use Jellyfin",
|
||||||
|
"components.Setup.signinWithPlex": "Sign in with Plex",
|
||||||
"components.Setup.syncingbackground": "Syncing will run in the background. You can continue the setup process in the meantime.",
|
"components.Setup.syncingbackground": "Syncing will run in the background. You can continue the setup process in the meantime.",
|
||||||
"components.Setup.tip": "Tip",
|
"components.Setup.tip": "Tip",
|
||||||
"components.Setup.welcome": "Welcome to Overseerr",
|
"components.Setup.welcome": "Welcome to Overseerr",
|
||||||
|
|||||||
@@ -6098,6 +6098,11 @@ express-openapi-validator@^4.11.0:
|
|||||||
ono "^7.1.3"
|
ono "^7.1.3"
|
||||||
path-to-regexp "^6.2.0"
|
path-to-regexp "^6.2.0"
|
||||||
|
|
||||||
|
express-rate-limit@^5.2.5:
|
||||||
|
version "5.2.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-5.2.5.tgz#956fde02aaf28724c0fd01b932986baa35143ece"
|
||||||
|
integrity sha512-fv9mf4hWRKZHVlY8ChVNYnGxa49m0zQ6CrJxNiXe2IjJPqicrqoA/JOyBbvs4ufSSLZ6NTzhtgEyLcdfbe+Q6Q==
|
||||||
|
|
||||||
express-session@^1.15.6, express-session@^1.17.1:
|
express-session@^1.15.6, express-session@^1.17.1:
|
||||||
version "1.17.1"
|
version "1.17.1"
|
||||||
resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.17.1.tgz#36ecbc7034566d38c8509885c044d461c11bf357"
|
resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.17.1.tgz#36ecbc7034566d38c8509885c044d461c11bf357"
|
||||||
|
|||||||
Reference in New Issue
Block a user