Plex api update #105
@@ -3,13 +3,15 @@
|
|||||||
# @Author: KevinMidboe
|
# @Author: KevinMidboe
|
||||||
# @Date: 2017-04-12 23:27:51
|
# @Date: 2017-04-12 23:27:51
|
||||||
# @Last Modified by: KevinMidboe
|
# @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 sys, sqlite3, json, os.path
|
||||||
import logging
|
import logging
|
||||||
import env_variables as env
|
import env_variables as env
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
import delugeClient.deluge_cli as delugeCli
|
||||||
|
|
||||||
class episode(object):
|
class episode(object):
|
||||||
def __init__(self, id):
|
def __init__(self, id):
|
||||||
self.id = id
|
self.id = id
|
||||||
@@ -91,6 +93,14 @@ def moveStray(strayId):
|
|||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
logging.warning('Cannot remove ' + ep.typeDir('parent_input') + ', file no longer exists.')
|
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 __name__ == '__main__':
|
||||||
if (os.path.exists(env.logfile)):
|
if (os.path.exists(env.logfile)):
|
||||||
logging.basicConfig(filename=env.logfile, level=logging.INFO)
|
logging.basicConfig(filename=env.logfile, level=logging.INFO)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class PlexRepository {
|
|||||||
return rp(options)
|
return rp(options)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result.MediaContainer.size > 0) {
|
if (result.MediaContainer.size > 0) {
|
||||||
const playing = result.MediaContainer.Video.map(convertPlexToStream);
|
const playing = result.MediaContainer.Metadata.map(convertPlexToStream);
|
||||||
return { size: Object.keys(playing).length, video: playing };
|
return { size: Object.keys(playing).length, video: playing };
|
||||||
}
|
}
|
||||||
return { size: 0, video: [] };
|
return { size: 0, video: [] };
|
||||||
|
|||||||
Reference in New Issue
Block a user