chore: rename Jellyseerr -> Seerr, part 1 (#1984)

* chore: rename Jellyseerr -> Seerr, part 1

* chore: update Jellyfin bot name
This commit is contained in:
TheCatLady
2025-10-06 15:22:36 -07:00
committed by GitHub
parent e7aed5b594
commit 2e2d2a031b
25 changed files with 93 additions and 100 deletions

View File

@@ -161,7 +161,7 @@ authRoutes.post('/plex', async (req, res, next) => {
});
} else {
logger.info(
'Sign-in attempt from Plex user with access to the media server; creating new Jellyseerr user',
'Sign-in attempt from Plex user with access to the media server; creating new Seerr user',
{
label: 'API',
ip: req.ip,
@@ -277,16 +277,14 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
select: { id: true, jellyfinDeviceId: true },
});
let deviceId = 'BOT_jellyseerr';
let deviceId = 'BOT_seerr';
if (user && user.id === 1) {
// Admin is always BOT_jellyseerr
deviceId = 'BOT_jellyseerr';
// Admin is always BOT_seerr
deviceId = 'BOT_seerr';
} else if (user && user.jellyfinDeviceId) {
deviceId = user.jellyfinDeviceId;
} else if (body.username) {
deviceId = Buffer.from(`BOT_jellyseerr_${body.username}`).toString(
'base64'
);
deviceId = Buffer.from(`BOT_seerr_${body.username}`).toString('base64');
}
// First we need to attempt to log the user in to jellyfin
@@ -334,7 +332,7 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
if (missingAdminUser) {
logger.info(
'Sign-in attempt from Jellyfin user with access to the media server; creating initial admin user for Jellyseerr',
'Sign-in attempt from Jellyfin user with access to the media server; creating initial admin user for Seerr',
{
label: 'API',
ip: req.ip,
@@ -363,7 +361,7 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
await userRepository.save(user);
} else {
logger.info(
'Sign-in attempt from Jellyfin user with access to the media server; editing admin user for Jellyseerr',
'Sign-in attempt from Jellyfin user with access to the media server; editing admin user for Seerr',
{
label: 'API',
ip: req.ip,
@@ -400,7 +398,7 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
account.AccessToken,
deviceId
);
const apiKey = await jellyfinClient.createApiToken('Jellyseerr');
const apiKey = await jellyfinClient.createApiToken('Seerr');
const serverName = await jellyfinserver.getServerName();
@@ -456,7 +454,7 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
});
} else if (!user) {
logger.info(
'Sign-in attempt from Jellyfin user with access to the media server; creating new Jellyseerr user',
'Sign-in attempt from Jellyfin user with access to the media server; creating new Seerr user',
{
label: 'API',
ip: req.ip,
@@ -616,7 +614,7 @@ authRoutes.post('/local', async (req, res, next) => {
.getOne();
if (!user || !(await user.passwordMatch(body.password))) {
logger.warn('Failed sign-in attempt using invalid Jellyseerr password', {
logger.warn('Failed sign-in attempt using invalid Seerr password', {
label: 'API',
ip: req.ip,
email: body.email,
@@ -705,15 +703,12 @@ authRoutes.post('/local', async (req, res, next) => {
return res.status(200).json(user?.filter() ?? {});
} catch (e) {
logger.error(
'Something went wrong authenticating with Jellyseerr password',
{
label: 'API',
errorMessage: e.message,
ip: req.ip,
email: body.email,
}
);
logger.error('Something went wrong authenticating with Seerr password', {
label: 'API',
errorMessage: e.message,
ip: req.ip,
email: body.email,
});
return next({
status: 500,
message: 'Unable to authenticate.',
@@ -747,7 +742,7 @@ authRoutes.post('/logout', async (req, res, next) => {
await axios.delete(`${baseUrl}/Devices`, {
params: { Id: user.jellyfinDeviceId },
headers: {
'X-Emby-Authorization': `MediaBrowser Client="Jellyseerr", Device="Jellyseerr", DeviceId="jellyseerr", Version="${getAppVersion()}", Token="${
'X-Emby-Authorization': `MediaBrowser Client="Seerr", Device="Seerr", DeviceId="seerr", Version="${getAppVersion()}", Token="${
settings.jellyfin.apiKey
}"`,
},

View File

@@ -23,11 +23,11 @@ async function initAvatarImageProxy() {
select: ['id', 'jellyfinUserId', 'jellyfinDeviceId'],
order: { id: 'ASC' },
});
const deviceId = admin?.jellyfinDeviceId || 'BOT_jellyseerr';
const deviceId = admin?.jellyfinDeviceId || 'BOT_seerr';
const authToken = getSettings().jellyfin.apiKey;
_avatarImageProxy = new ImageProxy('avatar', '', {
headers: {
'X-Emby-Authorization': `MediaBrowser Client="Jellyseerr", Device="Jellyseerr", DeviceId="${deviceId}", Version="${getAppVersion()}", Token="${authToken}"`,
'X-Emby-Authorization': `MediaBrowser Client="Seerr", Device="Seerr", DeviceId="${deviceId}", Version="${getAppVersion()}", Token="${authToken}"`,
},
});
}

View File

@@ -55,7 +55,7 @@ router.get<unknown, StatusResponse>('/status', async (req, res) => {
let commitsBehind = 0;
if (currentVersion.startsWith('develop-') && commitTag !== 'local') {
const commits = await githubApi.getJellyseerrCommits();
const commits = await githubApi.getSeerrCommits();
if (commits.length) {
const filteredCommits = commits.filter(
@@ -74,7 +74,7 @@ router.get<unknown, StatusResponse>('/status', async (req, res) => {
}
}
} else if (commitTag !== 'local') {
const releases = await githubApi.getJellyseerrReleases();
const releases = await githubApi.getSeerrReleases();
if (releases.length) {
const latestVersion = releases[0];
@@ -445,7 +445,7 @@ router.get('/certifications/tv', isAuthenticated(), async (req, res, next) => {
router.get('/', (_req, res) => {
return res.status(200).json({
api: 'Jellyseerr API',
api: 'Seerr API',
version: '1.0',
});
});

View File

@@ -633,7 +633,7 @@ router.post(
jellyfinUsername: jellyfinUser?.Name,
jellyfinUserId: jellyfinUser?.Id,
jellyfinDeviceId: Buffer.from(
`BOT_jellyseerr_${jellyfinUser?.Name ?? ''}`
`BOT_seerr_${jellyfinUser?.Name ?? ''}`
).toString('base64'),
email: jellyfinUser?.Name,
permissions: settings.main.defaultPermissions,

View File

@@ -312,7 +312,7 @@ userSettingsRoutes.post<{ authToken: string }>(
// Do not allow linking of an already linked account
if (await userRepository.exist({ where: { plexId: account.id } })) {
return res.status(422).json({
message: 'This Plex account is already linked to a Jellyseerr user',
message: 'This Plex account is already linked to a Seerr user',
});
}
@@ -415,15 +415,13 @@ userSettingsRoutes.post<{ username: string; password: string }>(
})
) {
return res.status(422).json({
message: 'The specified account is already linked to a Jellyseerr user',
message: 'The specified account is already linked to a Seerr user',
});
}
const hostname = getHostname();
const deviceId = Buffer.from(
req.user?.id === 1
? 'BOT_jellyseerr'
: `BOT_jellyseerr_${req.user.username ?? ''}`
req.user?.id === 1 ? 'BOT_seerr' : `BOT_seerr_${req.user.username ?? ''}`
).toString('base64');
const jellyfinserver = new JellyfinAPI(hostname, undefined, deviceId);
@@ -452,8 +450,7 @@ userSettingsRoutes.post<{ username: string; password: string }>(
})
) {
return res.status(422).json({
message:
'The specified account is already linked to a Jellyseerr user',
message: 'The specified account is already linked to a Seerr user',
});
}