mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat: about page initial version
Adding something to the about page for now, including the app version to better know what versions of the app people are running
This commit is contained in:
@@ -17,6 +17,9 @@ import { scheduledJobs } from '../job/schedule';
|
||||
import { Permission } from '../lib/permissions';
|
||||
import { isAuthenticated } from '../middleware/auth';
|
||||
import { merge } from 'lodash';
|
||||
import { version } from '../../package.json';
|
||||
import Media from '../entity/Media';
|
||||
import { MediaRequest } from '../entity/MediaRequest';
|
||||
|
||||
const settingsRoutes = Router();
|
||||
|
||||
@@ -431,4 +434,23 @@ settingsRoutes.post('/notifications/email', (req, res) => {
|
||||
res.status(200).json(settings.notifications.agents.email);
|
||||
});
|
||||
|
||||
settingsRoutes.get('/about', async (req, res) => {
|
||||
const mediaRepository = getRepository(Media);
|
||||
const mediaRequestRepository = getRepository(MediaRequest);
|
||||
|
||||
const totalMediaItems = await mediaRepository.count();
|
||||
const totalRequests = await mediaRequestRepository.count();
|
||||
|
||||
let finalVersion = version;
|
||||
|
||||
if (version === '0.1.0') {
|
||||
finalVersion = `develop-${process.env.COMMIT_TAG ?? 'local'}`;
|
||||
}
|
||||
return res.status(200).json({
|
||||
version: finalVersion,
|
||||
totalMediaItems,
|
||||
totalRequests,
|
||||
});
|
||||
});
|
||||
|
||||
export default settingsRoutes;
|
||||
|
Reference in New Issue
Block a user