From b99b5b32ec961858e38a42652fa6c0a74f701d88 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 6 May 2018 18:09:13 +0200 Subject: [PATCH 1/3] 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.') From 4fe85d9faefb4daa0f3227576ce9e1f3f37f68ce Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 6 May 2018 18:15:54 +0200 Subject: [PATCH 2/3] 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', From fe5f0c815eec99c1557ee5bb6047cc1f4793fc23 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 13 May 2018 19:18:45 +0200 Subject: [PATCH 3/3] 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)