mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
chore: rename Jellyseerr -> Seerr, part 1 (#1984)
* chore: rename Jellyseerr -> Seerr, part 1 * chore: update Jellyfin bot name
This commit is contained in:
@@ -76,14 +76,14 @@ class GithubAPI extends ExternalAPI {
|
||||
);
|
||||
}
|
||||
|
||||
public async getJellyseerrReleases({
|
||||
public async getSeerrReleases({
|
||||
take = 20,
|
||||
}: {
|
||||
take?: number;
|
||||
} = {}): Promise<GitHubRelease[]> {
|
||||
try {
|
||||
const data = await this.get<GitHubRelease[]>(
|
||||
'/repos/fallenbagel/jellyseerr/releases',
|
||||
'/repos/seerr-team/seerr/releases',
|
||||
{
|
||||
params: {
|
||||
per_page: take,
|
||||
@@ -94,14 +94,14 @@ class GithubAPI extends ExternalAPI {
|
||||
return data;
|
||||
} catch (e) {
|
||||
logger.warn(
|
||||
"Failed to retrieve GitHub releases. This may be an issue on GitHub's end. Jellyseerr can't check if it's on the latest version.",
|
||||
"Failed to retrieve GitHub releases. This may be an issue on GitHub's end. Seerr can't check if it's on the latest version.",
|
||||
{ label: 'GitHub API', errorMessage: e.message }
|
||||
);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public async getJellyseerrCommits({
|
||||
public async getSeerrCommits({
|
||||
take = 20,
|
||||
branch = 'develop',
|
||||
}: {
|
||||
@@ -110,7 +110,7 @@ class GithubAPI extends ExternalAPI {
|
||||
} = {}): Promise<GithubCommit[]> {
|
||||
try {
|
||||
const data = await this.get<GithubCommit[]>(
|
||||
'/repos/fallenbagel/jellyseerr/commits',
|
||||
'/repos/seerr-team/seerr/commits',
|
||||
{
|
||||
params: {
|
||||
per_page: take,
|
||||
@@ -122,7 +122,7 @@ class GithubAPI extends ExternalAPI {
|
||||
return data;
|
||||
} catch (e) {
|
||||
logger.warn(
|
||||
"Failed to retrieve GitHub commits. This may be an issue on GitHub's end. Jellyseerr can't check if it's on the latest version.",
|
||||
"Failed to retrieve GitHub commits. This may be an issue on GitHub's end. Seerr can't check if it's on the latest version.",
|
||||
{ label: 'GitHub API', errorMessage: e.message }
|
||||
);
|
||||
return [];
|
||||
|
||||
@@ -131,13 +131,13 @@ class JellyfinAPI extends ExternalAPI {
|
||||
const safeDeviceId =
|
||||
deviceId && deviceId.length > 0
|
||||
? deviceId
|
||||
: Buffer.from('BOT_jellyseerr').toString('base64');
|
||||
: Buffer.from('BOT_seerr').toString('base64');
|
||||
|
||||
let authHeaderVal: string;
|
||||
if (authToken) {
|
||||
authHeaderVal = `MediaBrowser Client="Jellyseerr", Device="Jellyseerr", DeviceId="${safeDeviceId}", Version="${getAppVersion()}", Token="${authToken}"`;
|
||||
authHeaderVal = `MediaBrowser Client="Seerr", Device="Seerr", DeviceId="${safeDeviceId}", Version="${getAppVersion()}", Token="${authToken}"`;
|
||||
} else {
|
||||
authHeaderVal = `MediaBrowser Client="Jellyseerr", Device="Jellyseerr", DeviceId="${safeDeviceId}", Version="${getAppVersion()}"`;
|
||||
authHeaderVal = `MediaBrowser Client="Seerr", Device="Seerr", DeviceId="${safeDeviceId}", Version="${getAppVersion()}"`;
|
||||
}
|
||||
|
||||
super(
|
||||
|
||||
@@ -124,9 +124,9 @@ class PlexAPI {
|
||||
// },
|
||||
options: {
|
||||
identifier: settings.clientId,
|
||||
product: 'Jellyseerr',
|
||||
deviceName: 'Jellyseerr',
|
||||
platform: 'Jellyseerr',
|
||||
product: 'Seerr',
|
||||
deviceName: 'Seerr',
|
||||
platform: 'Seerr',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ import path from 'path';
|
||||
import swaggerUi from 'swagger-ui-express';
|
||||
import YAML from 'yamljs';
|
||||
|
||||
const API_SPEC_PATH = path.join(__dirname, '../jellyseerr-api.yml');
|
||||
const API_SPEC_PATH = path.join(__dirname, '../seerr-api.yml');
|
||||
|
||||
logger.info(`Starting Jellyseerr version ${getAppVersion()}`);
|
||||
logger.info(`Starting Seerr version ${getAppVersion()}`);
|
||||
const dev = process.env.NODE_ENV !== 'production';
|
||||
const app = next({ dev });
|
||||
const handle = app.getRequestHandler();
|
||||
|
||||
@@ -192,7 +192,7 @@ class SlackAgent
|
||||
type: 'actions',
|
||||
elements: [
|
||||
{
|
||||
action_id: 'open-in-jellyseerr',
|
||||
action_id: 'open-in-seerr',
|
||||
type: 'button',
|
||||
url,
|
||||
text: {
|
||||
|
||||
@@ -380,7 +380,7 @@ class Settings {
|
||||
vapidPublic: '',
|
||||
main: {
|
||||
apiKey: '',
|
||||
applicationTitle: 'Jellyseerr',
|
||||
applicationTitle: 'Seerr',
|
||||
applicationUrl: '',
|
||||
cacheImages: false,
|
||||
defaultPermissions: Permission.REQUEST,
|
||||
@@ -447,7 +447,7 @@ class Settings {
|
||||
ignoreTls: false,
|
||||
requireTls: false,
|
||||
allowSelfSigned: false,
|
||||
senderName: 'Jellyseerr',
|
||||
senderName: 'Seerr',
|
||||
},
|
||||
},
|
||||
discord: {
|
||||
|
||||
@@ -28,7 +28,7 @@ const migrateApiTokens = async (settings: any): Promise<AllSettings> => {
|
||||
);
|
||||
jellyfinClient.setUserId(admin.jellyfinUserId ?? '');
|
||||
try {
|
||||
const apiKey = await jellyfinClient.createApiToken('Jellyseerr');
|
||||
const apiKey = await jellyfinClient.createApiToken('Seerr');
|
||||
settings.jellyfin.apiKey = apiKey;
|
||||
} catch {
|
||||
throw new Error(
|
||||
|
||||
@@ -44,7 +44,7 @@ export const runMigrations = async (
|
||||
}
|
||||
migrated = newSettings;
|
||||
} catch (e) {
|
||||
// we stop jellyseerr if the migration failed
|
||||
// we stop Seerr if the migration failed
|
||||
logger.error(
|
||||
`Error while running migration '${migration}': ${e.message}`,
|
||||
{
|
||||
@@ -81,7 +81,7 @@ export const runMigrations = async (
|
||||
await fs.writeFile(BACKUP_PATH, oldBackup.toString());
|
||||
}
|
||||
} catch (e) {
|
||||
// we stop jellyseerr if the migration failed
|
||||
// we stop Seerr if the migration failed
|
||||
logger.error(
|
||||
`Something went wrong while running settings migrations: ${e.message}`,
|
||||
{
|
||||
|
||||
@@ -130,7 +130,7 @@ class WatchlistSync {
|
||||
|
||||
switch (e.constructor) {
|
||||
// During watchlist sync, these errors aren't necessarily
|
||||
// a problem with Jellyseerr. Since we are auto syncing these constantly, it's
|
||||
// a problem with Seerr. Since we are auto syncing these constantly, it's
|
||||
// possible they are unexpectedly at their quota limit, for example. So we'll
|
||||
// instead log these as debug messages.
|
||||
case RequestPermissionError:
|
||||
|
||||
@@ -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
|
||||
}"`,
|
||||
},
|
||||
|
||||
@@ -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}"`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user