mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
updates to incorporate importMode for NzbDrone/Sonarr and Radarr
This commit is contained in:
parent
5d5d69ecdd
commit
94ba0b3354
4 changed files with 18 additions and 5 deletions
|
@ -99,6 +99,8 @@
|
||||||
remote_path = 0
|
remote_path = 0
|
||||||
##### Set to path where download client places completed downloads locally for this category
|
##### Set to path where download client places completed downloads locally for this category
|
||||||
watch_dir =
|
watch_dir =
|
||||||
|
##### Set to define import behavior Move or Copy
|
||||||
|
importMode = Copy
|
||||||
|
|
||||||
[SickBeard]
|
[SickBeard]
|
||||||
#### autoProcessing for TV Series
|
#### autoProcessing for TV Series
|
||||||
|
@ -167,6 +169,8 @@
|
||||||
remote_path = 0
|
remote_path = 0
|
||||||
##### Set to path where download client places completed downloads locally for this category
|
##### Set to path where download client places completed downloads locally for this category
|
||||||
watch_dir =
|
watch_dir =
|
||||||
|
##### Set to define import behavior Move or Copy
|
||||||
|
importMode = Copy
|
||||||
|
|
||||||
[HeadPhones]
|
[HeadPhones]
|
||||||
#### autoProcessing for Music
|
#### autoProcessing for Music
|
||||||
|
|
|
@ -148,6 +148,11 @@ class autoProcessMovie(object):
|
||||||
method = cfg["method"]
|
method = cfg["method"]
|
||||||
else:
|
else:
|
||||||
method = None
|
method = None
|
||||||
|
#added importMode for Radarr config
|
||||||
|
if section == "Radarr":
|
||||||
|
importMode = cfg.get("importMode","Move")
|
||||||
|
else:
|
||||||
|
importMode = None
|
||||||
delete_failed = int(cfg["delete_failed"])
|
delete_failed = int(cfg["delete_failed"])
|
||||||
wait_for = int(cfg["wait_for"])
|
wait_for = int(cfg["wait_for"])
|
||||||
ssl = int(cfg.get("ssl", 0))
|
ssl = int(cfg.get("ssl", 0))
|
||||||
|
@ -287,7 +292,7 @@ class autoProcessMovie(object):
|
||||||
logger.postprocess("Starting {0} scan for {1}".format(method, inputName), section)
|
logger.postprocess("Starting {0} scan for {1}".format(method, inputName), section)
|
||||||
|
|
||||||
if section == "Radarr":
|
if section == "Radarr":
|
||||||
payload = {'name': 'DownloadedMoviesScan', 'path': params['media_folder'], 'downloadClientId': download_id}
|
payload = {'name': 'DownloadedMoviesScan', 'path': params['media_folder'], 'downloadClientId': download_id,'importMode' : importMode}
|
||||||
if not download_id:
|
if not download_id:
|
||||||
payload.pop("downloadClientId")
|
payload.pop("downloadClientId")
|
||||||
logger.debug("Opening URL: {0} with PARAMS: {1}".format(baseURL, payload), section)
|
logger.debug("Opening URL: {0} with PARAMS: {1}".format(baseURL, payload), section)
|
||||||
|
|
|
@ -87,6 +87,8 @@ class autoProcessTV(object):
|
||||||
extract = 0
|
extract = 0
|
||||||
else:
|
else:
|
||||||
extract = int(cfg.get("extract", 0))
|
extract = int(cfg.get("extract", 0))
|
||||||
|
#get importmode, default to "Move" for consistency with legacy
|
||||||
|
importMode = cfg.get("importMode","Move")
|
||||||
|
|
||||||
if not os.path.isdir(dirName) and os.path.isfile(dirName): # If the input directory is a file, assume single file download and split dir/name.
|
if not os.path.isdir(dirName) and os.path.isfile(dirName): # If the input directory is a file, assume single file download and split dir/name.
|
||||||
dirName = os.path.split(os.path.normpath(dirName))[0]
|
dirName = os.path.split(os.path.normpath(dirName))[0]
|
||||||
|
@ -270,10 +272,10 @@ class autoProcessTV(object):
|
||||||
# params = {'sortKey': 'series.title', 'page': 1, 'pageSize': 1, 'sortDir': 'asc'}
|
# params = {'sortKey': 'series.title', 'page': 1, 'pageSize': 1, 'sortDir': 'asc'}
|
||||||
if remote_path:
|
if remote_path:
|
||||||
logger.debug("remote_path: {0}".format(remoteDir(dirName)), section)
|
logger.debug("remote_path: {0}".format(remoteDir(dirName)), section)
|
||||||
data = {"name": "DownloadedEpisodesScan", "path": remoteDir(dirName), "downloadClientId": download_id, "importMode": "Move"}
|
data = {"name": "DownloadedEpisodesScan", "path": remoteDir(dirName), "downloadClientId": download_id, "importMode": importMode}
|
||||||
else:
|
else:
|
||||||
logger.debug("path: {0}".format(dirName), section)
|
logger.debug("path: {0}".format(dirName), section)
|
||||||
data = {"name": "DownloadedEpisodesScan", "path": dirName, "downloadClientId": download_id, "importMode": "Move"}
|
data = {"name": "DownloadedEpisodesScan", "path": dirName, "downloadClientId": download_id, "importMode": importMode}
|
||||||
if not download_id:
|
if not download_id:
|
||||||
data.pop("downloadClientId")
|
data.pop("downloadClientId")
|
||||||
data = json.dumps(data)
|
data = json.dumps(data)
|
||||||
|
|
|
@ -384,8 +384,9 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
envCatKey = 'NZBPO_NDCATEGORY'
|
envCatKey = 'NZBPO_NDCATEGORY'
|
||||||
envKeys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
envKeys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
||||||
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH']
|
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH']
|
||||||
|
#new cfgKey added for importMode
|
||||||
cfgKeys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
cfgKeys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
||||||
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path']
|
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path','importMode']
|
||||||
if envCatKey in os.environ:
|
if envCatKey in os.environ:
|
||||||
for index in range(len(envKeys)):
|
for index in range(len(envKeys)):
|
||||||
key = 'NZBPO_ND{index}'.format(index=envKeys[index])
|
key = 'NZBPO_ND{index}'.format(index=envKeys[index])
|
||||||
|
@ -403,8 +404,9 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
envCatKey = 'NZBPO_RACATEGORY'
|
envCatKey = 'NZBPO_RACATEGORY'
|
||||||
envKeys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
envKeys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
||||||
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH', 'OMDBAPIKEY']
|
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH', 'OMDBAPIKEY']
|
||||||
|
#new cfgKey added for importMode
|
||||||
cfgKeys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
cfgKeys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
||||||
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path', 'omdbapikey']
|
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path', 'omdbapikey','importMode']
|
||||||
if envCatKey in os.environ:
|
if envCatKey in os.environ:
|
||||||
for index in range(len(envKeys)):
|
for index in range(len(envKeys)):
|
||||||
key = 'NZBPO_RA{index}'.format(index=envKeys[index])
|
key = 'NZBPO_RA{index}'.format(index=envKeys[index])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue