From b99b5b32ec961858e38a42652fa6c0a74f701d88 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 6 May 2018 18:09:13 +0200 Subject: [PATCH 1/5] Updated to use abspath of the file not the call location. --- app/moveSeasoned.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/moveSeasoned.py b/app/moveSeasoned.py index 0894559..9a9c6f9 100755 --- a/app/moveSeasoned.py +++ b/app/moveSeasoned.py @@ -92,7 +92,9 @@ def moveStray(strayId): logging.warning('Cannot remove ' + ep.typeDir('parent_input') + ', file no longer exists.') if __name__ == '__main__': - if (os.path.exists(env.logfile)): + abspath = os.path.abspath(__file__) + dname = os.path.dirname(abspath) + if (os.path.exists(os.path.join(dname, env.logfile))): logging.basicConfig(filename=env.logfile, level=logging.INFO) else: print('Logfile could not be found at ' + env.logfile + '. Verifiy presence or disable logging in config.') -- 2.34.1 From 4fe85d9faefb4daa0f3227576ce9e1f3f37f68ce Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 6 May 2018 18:15:54 +0200 Subject: [PATCH 2/5] Change the ordering of user requests to be newest-first. --- seasoned_api/src/plex/requestRepository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seasoned_api/src/plex/requestRepository.js b/seasoned_api/src/plex/requestRepository.js index 4695eda..447384e 100644 --- a/seasoned_api/src/plex/requestRepository.js +++ b/seasoned_api/src/plex/requestRepository.js @@ -18,7 +18,7 @@ class RequestRepository { fetchRequestedItemsByStatus: 'SELECT * FROM requests WHERE status IS ? AND type LIKE ? ORDER BY date DESC LIMIT 25 OFFSET ?*25-25', updateRequestedById: 'UPDATE requests SET status = ? WHERE id is ? AND type is ?', checkIfIdRequested: 'SELECT * FROM requests WHERE id IS ? AND type IS ?', - userRequests: 'SELECT * FROM requests WHERE requested_by IS ?', + userRequests: 'SELECT * FROM requests WHERE requested_by IS ? ORDER BY date DESC', }; this.cacheTags = { search: 'se', -- 2.34.1 From fe5f0c815eec99c1557ee5bb6047cc1f4793fc23 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 13 May 2018 19:18:45 +0200 Subject: [PATCH 3/5] Deluge is now imported and a Deluge class is created and remove function called for name of torrent that is being verified. --- app/moveSeasoned.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/moveSeasoned.py b/app/moveSeasoned.py index 0894559..96f3a52 100755 --- a/app/moveSeasoned.py +++ b/app/moveSeasoned.py @@ -3,13 +3,15 @@ # @Author: KevinMidboe # @Date: 2017-04-12 23:27:51 # @Last Modified by: KevinMidboe -# @Last Modified time: 2017-06-27 15:58:09 +# @Last Modified time: 2018-05-13 19:17:17 import sys, sqlite3, json, os.path import logging import env_variables as env import shutil +import delugeClient.deluge_cli as delugeCli + class episode(object): def __init__(self, id): self.id = id @@ -91,6 +93,14 @@ def moveStray(strayId): except FileNotFoundError: logging.warning('Cannot remove ' + ep.typeDir('parent_input') + ', file no longer exists.') + # Remove from deluge client + logging.info('Removing {} for deluge'.format(ep.name)) + deluge = delugeCli.Deluge() + response = deluge.remove(ep.name) + logging.info('Deluge response after delete: {}'.format(response)) + + + if __name__ == '__main__': if (os.path.exists(env.logfile)): logging.basicConfig(filename=env.logfile, level=logging.INFO) -- 2.34.1 From c10bbcf5182598be90f0f6def5827378cfd356ef Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 28 Jul 2018 15:58:02 +0200 Subject: [PATCH 4/5] Added update function to package.json fole. --- seasoned_api/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/seasoned_api/package.json b/seasoned_api/package.json index 9349cb4..38e4af1 100644 --- a/seasoned_api/package.json +++ b/seasoned_api/package.json @@ -7,10 +7,11 @@ }, "main": "webserver/server.js", "scripts": { - "start": "cross-env SEASONED_CONFIG=conf/development.json NODE_PATH=. node src/webserver/server.js", + "start": "cross-env SEASONED_CONFIG=conf/development.json PROD=true NODE_PATH=. node src/webserver/server.js", "test": "cross-env SEASONED_CONFIG=conf/test.json NODE_PATH=. mocha --recursive test", "coverage": "cross-env SEASONED_CONFIG=conf/test.json NODE_PATH=. nyc mocha --recursive test && nyc report --reporter=text-lcov | coveralls", - "lint": "./node_modules/.bin/eslint src/" + "lint": "./node_modules/.bin/eslint src/", + "update": "cross-env SEASONED_CONFIG=conf/development.json NODE_PATH=. node src/plex/updateRequestsInPlex.js" }, "dependencies": { "bcrypt-nodejs": "^0.0.3", -- 2.34.1 From 7dd016a56e2baff6f5d82d37c607f7e734c0030e Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 28 Jul 2018 16:05:22 +0200 Subject: [PATCH 5/5] Changed the python run variable for stray eps. --- seasoned_api/src/seasoned/strayRepository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seasoned_api/src/seasoned/strayRepository.js b/seasoned_api/src/seasoned/strayRepository.js index 05ae66f..19ad8bb 100644 --- a/seasoned_api/src/seasoned/strayRepository.js +++ b/seasoned_api/src/seasoned/strayRepository.js @@ -43,7 +43,7 @@ class StrayRepository { assert.notEqual(row, undefined, `Stray '${strayId}' already verified.`); const options = { - pythonPath: '/usr/bin/python3', + pythonPath: '../app/env/bin/python3', args: [strayId], }; -- 2.34.1