diff --git a/README.md b/README.md index a99ba8c..4cd986d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Transmission RSS Manager v2.0.9 +# Transmission RSS Manager v2.0.10 A comprehensive web-based tool to automate and manage your Transmission torrent downloads with RSS feed integration, intelligent media organization, and enhanced security features. Now with automatic updates and easy installation! @@ -14,6 +14,11 @@ If you installed using the bootstrap installer, these requirements should be met ## Changelog +### v2.0.10 (2025-03-10) +- **Fixed**: Fixed "fs.existsSync is not a function" error in update check +- **Improved**: Better error handling for git repository checks +- **Improved**: More robust file system operations for update detection + ### v2.0.9 (2025-03-07) - **Fixed**: Update button now appears properly on dashboard - **Fixed**: Remote Transmission connection issues resolved diff --git a/modules/post-processor b/modules/post-processor new file mode 120000 index 0000000..0ff4b14 --- /dev/null +++ b/modules/post-processor @@ -0,0 +1 @@ +post-processor.js \ No newline at end of file diff --git a/modules/postProcessor b/modules/postProcessor new file mode 120000 index 0000000..0ff4b14 --- /dev/null +++ b/modules/postProcessor @@ -0,0 +1 @@ +post-processor.js \ No newline at end of file diff --git a/modules/postProcessor.js b/modules/postProcessor.js new file mode 120000 index 0000000..0ff4b14 --- /dev/null +++ b/modules/postProcessor.js @@ -0,0 +1 @@ +post-processor.js \ No newline at end of file diff --git a/modules/rss-feed-manager b/modules/rss-feed-manager new file mode 120000 index 0000000..262afda --- /dev/null +++ b/modules/rss-feed-manager @@ -0,0 +1 @@ +rss-feed-manager.js \ No newline at end of file diff --git a/modules/rssFeedManager b/modules/rssFeedManager new file mode 120000 index 0000000..262afda --- /dev/null +++ b/modules/rssFeedManager @@ -0,0 +1 @@ +rss-feed-manager.js \ No newline at end of file diff --git a/modules/rssFeedManager.js b/modules/rssFeedManager.js new file mode 120000 index 0000000..262afda --- /dev/null +++ b/modules/rssFeedManager.js @@ -0,0 +1 @@ +rss-feed-manager.js \ No newline at end of file diff --git a/modules/transmission-client b/modules/transmission-client new file mode 120000 index 0000000..9774e58 --- /dev/null +++ b/modules/transmission-client @@ -0,0 +1 @@ +transmission-client.js \ No newline at end of file diff --git a/modules/transmissionClient b/modules/transmissionClient new file mode 120000 index 0000000..9774e58 --- /dev/null +++ b/modules/transmissionClient @@ -0,0 +1 @@ +transmission-client.js \ No newline at end of file diff --git a/modules/transmissionClient.js b/modules/transmissionClient.js new file mode 120000 index 0000000..9774e58 --- /dev/null +++ b/modules/transmissionClient.js @@ -0,0 +1 @@ +transmission-client.js \ No newline at end of file diff --git a/package.json b/package.json index 8db4fa2..b87e199 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "transmission-rss-manager", - "version": "2.0.9", + "version": "2.0.10", "description": "A comprehensive web-based tool to automate and manage your Transmission torrent downloads with RSS feed integration and intelligent media organization", "main": "server.js", "scripts": { diff --git a/server.js b/server.js index 56a442b..df31016 100644 --- a/server.js +++ b/server.js @@ -5,8 +5,7 @@ const express = require('express'); const path = require('path'); -const fsPromises = require('fs').promises; -const fs = require('fs'); // Regular fs module for synchronous operations +const fs = require('fs').promises; const bodyParser = require('body-parser'); const cors = require('cors'); const morgan = require('morgan'); @@ -216,7 +215,7 @@ async function loadConfig() { try { // Try to read existing config from primary location console.log(`Trying to load config from: ${DEFAULT_CONFIG_PATH}`); - const configData = await fsPromises.readFile(DEFAULT_CONFIG_PATH, 'utf8'); + const configData = await fs.readFile(DEFAULT_CONFIG_PATH, 'utf8'); const loadedConfig = JSON.parse(configData); // Use recursive merge function to merge configs @@ -237,7 +236,7 @@ async function loadConfig() { console.log(`Config not found at ${DEFAULT_CONFIG_PATH}, trying fallback location...`); try { - const fallbackData = await fsPromises.readFile(FALLBACK_CONFIG_PATH, 'utf8'); + const fallbackData = await fs.readFile(FALLBACK_CONFIG_PATH, 'utf8'); const fallbackConfig = JSON.parse(fallbackData); // Merge configs @@ -252,8 +251,8 @@ async function loadConfig() { // Try to save to primary location, but don't fail if we can't try { // Create directory if it doesn't exist - await fsPromises.mkdir(path.dirname(DEFAULT_CONFIG_PATH), { recursive: true }); - await fsPromises.writeFile(DEFAULT_CONFIG_PATH, JSON.stringify(mergedConfig, null, 2), 'utf8'); + await fs.mkdir(path.dirname(DEFAULT_CONFIG_PATH), { recursive: true }); + await fs.writeFile(DEFAULT_CONFIG_PATH, JSON.stringify(mergedConfig, null, 2), 'utf8'); console.log(`Migrated config from ${FALLBACK_CONFIG_PATH} to ${DEFAULT_CONFIG_PATH}`); } catch (saveError) { console.warn(`Could not save config to ${DEFAULT_CONFIG_PATH}: ${saveError.message}`); @@ -269,15 +268,15 @@ async function loadConfig() { // Try to save to primary location first try { - await fsPromises.mkdir(path.dirname(DEFAULT_CONFIG_PATH), { recursive: true }); - await fsPromises.writeFile(DEFAULT_CONFIG_PATH, JSON.stringify(defaultConfig, null, 2), 'utf8'); + await fs.mkdir(path.dirname(DEFAULT_CONFIG_PATH), { recursive: true }); + await fs.writeFile(DEFAULT_CONFIG_PATH, JSON.stringify(defaultConfig, null, 2), 'utf8'); console.log(`Created default config at ${DEFAULT_CONFIG_PATH}`); } catch (saveError) { console.warn(`Could not save config to ${DEFAULT_CONFIG_PATH}: ${saveError.message}`); console.warn('Saving to fallback location instead'); // Save to fallback location instead - await fsPromises.writeFile(FALLBACK_CONFIG_PATH, JSON.stringify(defaultConfig, null, 2), 'utf8'); + await fs.writeFile(FALLBACK_CONFIG_PATH, JSON.stringify(defaultConfig, null, 2), 'utf8'); console.log(`Created default config at ${FALLBACK_CONFIG_PATH}`); } @@ -352,8 +351,8 @@ async function saveConfig(config) { // Always try to save to the primary config location first try { // Make sure directory exists - await fsPromises.mkdir(path.dirname(DEFAULT_CONFIG_PATH), { recursive: true }); - await fsPromises.writeFile(DEFAULT_CONFIG_PATH, JSON.stringify(config, null, 2), 'utf8'); + await fs.mkdir(path.dirname(DEFAULT_CONFIG_PATH), { recursive: true }); + await fs.writeFile(DEFAULT_CONFIG_PATH, JSON.stringify(config, null, 2), 'utf8'); console.log(`Configuration saved to ${DEFAULT_CONFIG_PATH}`); return; } catch (primaryError) { @@ -361,7 +360,7 @@ async function saveConfig(config) { console.warn('Trying fallback location...'); // If we couldn't save to the primary location, try the fallback - await fsPromises.writeFile(FALLBACK_CONFIG_PATH, JSON.stringify(config, null, 2), 'utf8'); + await fs.writeFile(FALLBACK_CONFIG_PATH, JSON.stringify(config, null, 2), 'utf8'); console.log(`Configuration saved to fallback location: ${FALLBACK_CONFIG_PATH}`); } } catch (error) { @@ -387,8 +386,8 @@ async function startServer() { config.securitySettings?.sslKeyPath) { try { const sslOptions = { - key: await fsPromises.readFile(config.securitySettings.sslKeyPath), - cert: await fsPromises.readFile(config.securitySettings.sslCertPath) + key: await fs.readFile(config.securitySettings.sslKeyPath), + cert: await fs.readFile(config.securitySettings.sslCertPath) }; server = https.createServer(sslOptions, app); @@ -1087,17 +1086,17 @@ async function getMediaLibrary(searchQuery) { try { // Check if directory exists - await fsPromises.access(destinationPath); + await fs.access(destinationPath); // Get directory listing - const files = await fsPromises.readdir(destinationPath, { withFileTypes: true }); + const files = await fs.readdir(destinationPath, { withFileTypes: true }); // Process each file/directory for (const file of files) { const fullPath = path.join(destinationPath, file.name); try { - const stats = await fsPromises.stat(fullPath); + const stats = await fs.stat(fullPath); // Create an item object const item = {