refactor: use enums instead of numbers
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
|
import { MediaServerType } from '@server/constants/server';
|
||||||
import type { AllSettings } from '@server/lib/settings';
|
import type { AllSettings } from '@server/lib/settings';
|
||||||
|
|
||||||
const migrateHostname = (settings: any): AllSettings => {
|
const migrateHostname = (settings: any): AllSettings => {
|
||||||
const oldMediaServerType = settings.main.mediaServerType;
|
const oldMediaServerType = settings.main.mediaServerType;
|
||||||
console.log('Migrating media server type', oldMediaServerType);
|
console.log('Migrating media server type', oldMediaServerType);
|
||||||
if (oldMediaServerType === 2 && process.env.JELLYFIN_TYPE === 'emby') {
|
if (
|
||||||
settings.main.mediaServerType = 3;
|
oldMediaServerType === MediaServerType.JELLYFIN &&
|
||||||
|
process.env.JELLYFIN_TYPE === 'emby'
|
||||||
|
) {
|
||||||
|
settings.main.mediaServerType = MediaServerType.EMBY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return settings;
|
return settings;
|
||||||
|
|||||||
Reference in New Issue
Block a user