From 37ca467718ff2609f6a6cf3931f1f09f614287aa Mon Sep 17 00:00:00 2001 From: Zeyphros Date: Tue, 23 Jan 2024 23:07:03 +0100 Subject: [PATCH] Improvements --- src/lib/seedbox/SeedboxController.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/lib/seedbox/SeedboxController.js b/src/lib/seedbox/SeedboxController.js index 50fe302..b130525 100644 --- a/src/lib/seedbox/SeedboxController.js +++ b/src/lib/seedbox/SeedboxController.js @@ -67,7 +67,7 @@ export default class SeedboxController { async importFile(seedbox, origin, destination) { logger.log('INFO', `Downloading file from ${seedbox.name}: ${origin}. Saving to ${destination}`); - mkdirp(dirname(destination)); + mkdirp.sync(dirname(destination)); try { // Add a suffix to the file while downloading to prevent potential errors while running an import @@ -149,12 +149,17 @@ export default class SeedboxController { logger.log('INFO', `Found new movie on ${seedbox.name}: ${basename(file)}`); + const destination = path.join( + this.oblecto.config.movies.directories[0].path, + basename(file) + ); + // Download the file to the first movie directory path // TODO: Add config for where imported files should be stored this.importQueue.pushJob('importMovie', { seedbox, origin: file, - destination: path.join(this.oblecto.config.movies.directories[0].path, basename(file)) + destination }); } } @@ -185,12 +190,18 @@ export default class SeedboxController { logger.log('INFO', `Found new episode on ${seedbox.name}: ${basename(file)}`); + const destination = path.join( + this.oblecto.config.tvshows.directories[0].path, + identification.series.seriesName, + basename(file) + ); + // Download the file to the first movie directory path // TODO: Add config for where imported files should be stored this.importQueue.pushJob('importEpisode', { seedbox, origin: file, - destination: path.join(this.oblecto.config.tvshows.directories[0].path, identification.series.seriesName, basename(file)) + destination }); } }