mirror of
https://github.com/sct/overseerr.git
synced 2025-09-30 15:40:40 +02:00
fix(ui): Dynamically generate path to config in warning message (#851)
This commit is contained in:
@@ -8,7 +8,9 @@ const UPDATE_INTERVAL_MSEC = 24 * 3600 * 1000; // how often to download new mapp
|
||||
// originally at https://raw.githubusercontent.com/ScudLee/anime-lists/master/anime-list.xml
|
||||
const MAPPING_URL =
|
||||
'https://raw.githubusercontent.com/Anime-Lists/anime-lists/master/anime-list.xml';
|
||||
const LOCAL_PATH = path.join(__dirname, '../../config/anime-list.xml');
|
||||
const LOCAL_PATH = process.env.CONFIG_DIRECTORY
|
||||
? `${process.env.CONFIG_DIRECTORY}/anime-list.xml`
|
||||
: path.join(__dirname, '../../config/anime-list.xml');
|
||||
|
||||
const mappingRegexp = new RegExp(/;[0-9]+-([0-9]+)/g);
|
||||
|
||||
|
@@ -15,7 +15,7 @@ import personRoutes from './person';
|
||||
import collectionRoutes from './collection';
|
||||
import { getAppVersion, getCommitTag } from '../utils/appVersion';
|
||||
import serviceRoutes from './service';
|
||||
import { appDataStatus } from '../utils/appDataVolume';
|
||||
import { appDataStatus, appDataPath } from '../utils/appDataVolume';
|
||||
|
||||
const router = Router();
|
||||
|
||||
@@ -31,6 +31,7 @@ router.get('/status', (req, res) => {
|
||||
router.get('/status/appdata', (_req, res) => {
|
||||
return res.status(200).json({
|
||||
appData: appDataStatus(),
|
||||
appDataPath: appDataPath(),
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -1,8 +1,16 @@
|
||||
import { existsSync } from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const DOCKER_PATH = path.join(__dirname, '../../config/DOCKER');
|
||||
const CONFIG_PATH = process.env.CONFIG_DIRECTORY
|
||||
? process.env.CONFIG_DIRECTORY
|
||||
: path.join(__dirname, '../../config');
|
||||
|
||||
const DOCKER_PATH = `${CONFIG_PATH}/DOCKER`;
|
||||
|
||||
export const appDataStatus = (): boolean => {
|
||||
return !existsSync(DOCKER_PATH);
|
||||
};
|
||||
|
||||
export const appDataPath = (): string => {
|
||||
return CONFIG_PATH;
|
||||
};
|
||||
|
Reference in New Issue
Block a user