diff --git a/README.md b/README.md index 0c90bb3..39ff661 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,15 @@ -# Transmission RSS Manager v2.0.7 +# Transmission RSS Manager v2.0.8 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! ## Changelog +### v2.0.8 (2025-03-07) +- **Fixed**: Module import issues on fresh installations with proper file extension handling +- **Fixed**: Adding compatibility symlinks for different module naming styles +- **Improved**: Server.js now uses consistent module import paths with .js extensions +- **Improved**: More robust module file handling in the installer + ### v2.0.7 (2025-03-07) - **Fixed**: Installation directory handling with prompt for choosing install path - **Fixed**: Bootstrap-installer now defaults to /opt/trans-install with user configuration option diff --git a/modules/file-creator-module.sh b/modules/file-creator-module.sh index f89285c..743652b 100644 --- a/modules/file-creator-module.sh +++ b/modules/file-creator-module.sh @@ -136,8 +136,9 @@ const cors = require('cors'); const Transmission = require('transmission'); // Import custom modules -const PostProcessor = require('./modules/postProcessor'); -const RssFeedManager = require('./modules/rssFeedManager'); +const PostProcessor = require('./modules/post-processor.js'); +const RssFeedManager = require('./modules/rss-feed-manager.js'); +const TransmissionClient = require('./modules/transmission-client.js'); // Initialize Express app const app = express(); @@ -1823,6 +1824,20 @@ function copy_module_files() { echo "Copying module: $module_name" cp "$js_file" "$INSTALL_DIR/modules/$module_name" + # Create symlinks for alternative module names that might be referenced + base_name=$(basename "$module_name" .js) + case "$base_name" in + "rss-feed-manager") + ln -sf "$INSTALL_DIR/modules/$module_name" "$INSTALL_DIR/modules/rssFeedManager.js" + ;; + "post-processor") + ln -sf "$INSTALL_DIR/modules/$module_name" "$INSTALL_DIR/modules/postProcessor.js" + ;; + "transmission-client") + ln -sf "$INSTALL_DIR/modules/$module_name" "$INSTALL_DIR/modules/transmissionClient.js" + ;; + esac + # Set permissions chown "$USER:$USER" "$INSTALL_DIR/modules/$module_name" chmod 644 "$INSTALL_DIR/modules/$module_name" diff --git a/package.json b/package.json index 8de5c66..7d1322c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "transmission-rss-manager", - "version": "2.0.7", + "version": "2.0.8", "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 f11caf8..6321fc6 100644 --- a/server.js +++ b/server.js @@ -18,37 +18,26 @@ const bcrypt = require('bcrypt'); // Try to import with .js extension first, then fallback to no extension for better compatibility let RssFeedManager, TransmissionClient, PostProcessor; +// Always use explicit .js extension when importing our own modules try { RssFeedManager = require('./modules/rss-feed-manager.js'); -} catch (e) { - try { - RssFeedManager = require('./modules/rss-feed-manager'); - } catch (err) { - console.error('Failed to load RssFeedManager module:', err); - process.exit(1); - } +} catch (err) { + console.error('Failed to load RssFeedManager module:', err); + process.exit(1); } try { TransmissionClient = require('./modules/transmission-client.js'); -} catch (e) { - try { - TransmissionClient = require('./modules/transmission-client'); - } catch (err) { - console.error('Failed to load TransmissionClient module:', err); - process.exit(1); - } +} catch (err) { + console.error('Failed to load TransmissionClient module:', err); + process.exit(1); } try { PostProcessor = require('./modules/post-processor.js'); -} catch (e) { - try { - PostProcessor = require('./modules/post-processor'); - } catch (err) { - console.error('Failed to load PostProcessor module:', err); - process.exit(1); - } +} catch (err) { + console.error('Failed to load PostProcessor module:', err); + process.exit(1); } // Constants and configuration