Make version number dynamic in server.js template

Instead of hardcoding the version number in the server.js template,
this change reads the version dynamically from package.json.
This ensures that the dashboard always displays the correct version
number without requiring manual updates to the template file.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
MasterDraco 2025-03-05 10:28:36 +00:00
parent e7076859b7
commit 16a7c0c0b6

View File

@ -265,11 +265,15 @@ app.use(bodyParser.urlencoded({ extended: true, limit: '50mb' }));
// API routes // API routes
//============================== //==============================
// Get the version from package.json
const packageJson = require('./package.json');
const appVersion = packageJson.version;
// Server status API // Server status API
app.get('/api/status', (req, res) => { app.get('/api/status', (req, res) => {
res.json({ res.json({
status: 'running', status: 'running',
version: '2.0.6', version: appVersion,
transmissionConnected: !!transmissionClient, transmissionConnected: !!transmissionClient,
postProcessorActive: postProcessor && postProcessor.processingIntervalId !== null, postProcessorActive: postProcessor && postProcessor.processingIntervalId !== null,
rssFeedManagerActive: rssFeedManager && rssFeedManager.updateIntervalId !== null, rssFeedManagerActive: rssFeedManager && rssFeedManager.updateIntervalId !== null,