Skip to content

Commit bec2302

Browse files
committed
fix(settings): ensure jobs restart after media server switch
1 parent 560562d commit bec2302

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

server/routes/settings/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,13 @@ settingsRoutes.post(
563563
.delete()
564564
.from(Session)
565565
.execute();
566-
startJobs();
567-
return res.status(200).json({
566+
res.status(200).json({
568567
message: useEmby
569568
? 'Switched to Emby. All users have been logged out. Restart the server, then sign in with the new media server.'
570569
: 'Switched to Jellyfin. All users have been logged out. Restart the server, then sign in with the new media server.',
571570
});
571+
setImmediate(() => startJobs());
572+
return;
572573
}
573574

574575
if (
@@ -632,11 +633,11 @@ settingsRoutes.post(
632633
.delete()
633634
.from(Session)
634635
.execute();
635-
startJobs();
636-
637-
return res.status(200).json({
636+
res.status(200).json({
638637
message: `Switched to ${serverName}. All users have been logged out. Restart the server, then sign in with the new media server.`,
639638
});
639+
setImmediate(() => startJobs());
640+
return;
640641
}
641642
} catch (e) {
642643
logger.error('Switch media server failed', {

0 commit comments

Comments
 (0)