mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
add plex library update. Fixes #566
This commit is contained in:
parent
3600c224d3
commit
042fcce6b7
5 changed files with 51 additions and 3 deletions
|
@ -1053,6 +1053,25 @@ def server_responding(baseURL):
|
|||
except (requests.ConnectionError, requests.exceptions.Timeout):
|
||||
return False
|
||||
|
||||
def plex_update(category):
|
||||
logger.debug("Attempting to update Plex Library for category %s." %(category), 'PLEX')
|
||||
if core.PLEXSSL:
|
||||
ulr = 'https://'
|
||||
else:
|
||||
url = 'http://'
|
||||
url = url + core.PLEXHOST + ':' + core.PLEXPORT + '/library/sections/'
|
||||
section = None
|
||||
for item in core.PLEXSEC:
|
||||
if item[0] == category:
|
||||
section = item[1]
|
||||
|
||||
if section:
|
||||
url = url + section + '/refresh?X-Plex-Token=' + core.PLEXTOKEN
|
||||
requests.get(url, timeout=(60, 120), verify=False)
|
||||
logger.debug("Plex Library has been refreshed.", 'PLEX')
|
||||
else:
|
||||
logger.debug("Could not identify section for plex update", 'PLEX')
|
||||
|
||||
def backupVersionedFile(old_file, version):
|
||||
numTries = 0
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue