diff --git a/app/classedStray.py b/app/classedStray.py index c4f8a9e..36e94ef 100755 --- a/app/classedStray.py +++ b/app/classedStray.py @@ -92,7 +92,7 @@ class strayEpisode(object): def analyseSubtitles(self, subFile): # TODO verify that it is a file try: - subtitlePath = os.path.join([env.show_dir, self.parent, subFile]) + subtitlePath = os.path.join([env.input_dir, self.parent, subFile]) except TypeError: # TODO don't get a list in subtitlePath return self.removeUploadSign(subFile) @@ -131,7 +131,7 @@ class strayEpisode(object): conn = sqlite3.connect(env.db_path) c = conn.cursor() - path = '/'.join([env.show_dir, self.parent]) + path = '/'.join([env.input_dir, self.parent]) video_files = json.dumps(self.videoFiles) subtitles = json.dumps(self.subtitles) trash = json.dumps(self.trash) @@ -149,7 +149,7 @@ class strayEpisode(object): -def getDirContent(dir=env.show_dir): +def getDirContent(dir=env.input_dir): # TODO What if item in db is not in this list? try: return [d for d in os.listdir(dir) if d[0] != '.'] @@ -189,12 +189,12 @@ def XOR(list1, list2): def filterChildItems(parent): try: - children = getDirContent('/'.join([env.show_dir, parent])) + children = getDirContent('/'.join([env.input_dir, parent])) if children: strayEpisode(parent, children) except FileNotFoundError: # TODO Log to error file - logging.info('Error: "' + '/'.join([env.show_dir, parent]) + '" is not a valid directory.') + logging.info('Error: "' + '/'.join([env.input_dir, parent]) + '" is not a valid directory.') def getNewItems(): newItems = XOR(getDirContent(), getShowNames()) @@ -221,3 +221,4 @@ if __name__ == '__main__': while True: main() sleep(30) + diff --git a/seasoned_api/src/plex/plexRepository.js b/seasoned_api/src/plex/plexRepository.js index 9e53c4b..4bfcff7 100644 --- a/seasoned_api/src/plex/plexRepository.js +++ b/seasoned_api/src/plex/plexRepository.js @@ -7,7 +7,7 @@ class PlexRepository { searchMedia(query) { var options = { - uri: 'http://10.0.0.41:32400/search?query=' + query, + uri: 'http://10.0.0.42:32400/search?query=' + query, headers: { 'Accept': 'application/json' }, @@ -53,4 +53,4 @@ class PlexRepository { } } -module.exports = PlexRepository; \ No newline at end of file +module.exports = PlexRepository; diff --git a/seasoned_api/src/webserver/app.js b/seasoned_api/src/webserver/app.js index db9bb35..9b63fee 100644 --- a/seasoned_api/src/webserver/app.js +++ b/seasoned_api/src/webserver/app.js @@ -34,7 +34,7 @@ router.use(function(req, res, next) { res.setHeader('Access-Control-Allow-Origin', origin); } res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization'); - res.header('Access-Control-Allow-Methods', 'POST, GET', 'PUT'); + res.header('Access-Control-Allow-Methods', 'POST, GET, PUT'); next(); });