notify watcher full filename when torrent is only one file, without directory

This commit is contained in:
Sergio Cambra 2019-11-03 23:07:41 +01:00
commit 2e631b7e11

View file

@ -213,6 +213,8 @@ def process(section, dir_name, input_name=None, status=0, client_agent='manual',
logger.postprocess('Starting DownloadedMoviesScan scan for {0}'.format(input_name), section) logger.postprocess('Starting DownloadedMoviesScan scan for {0}'.format(input_name), section)
if section == 'Watcher3': if section == 'Watcher3':
if input_name and os.path.isfile(os.path.join(dir_name, input_name)):
params['media_folder'] = os.path.join(params['media_folder'], input_name)
payload = {'apikey': apikey, 'path': params['media_folder'], 'guid': download_id, 'mode': 'complete'} payload = {'apikey': apikey, 'path': params['media_folder'], 'guid': download_id, 'mode': 'complete'}
if not download_id: if not download_id:
payload.pop('guid') payload.pop('guid')
@ -290,6 +292,8 @@ def process(section, dir_name, input_name=None, status=0, client_agent='manual',
elif section == 'Watcher3': elif section == 'Watcher3':
logger.postprocess('Sending failed download to {0} for CDH processing'.format(section), section) logger.postprocess('Sending failed download to {0} for CDH processing'.format(section), section)
path = remote_dir(dir_name) if remote_path else dir_name path = remote_dir(dir_name) if remote_path else dir_name
if input_name and os.path.isfile(os.path.join(dir_name, input_name)):
path = os.path.join(path, input_name)
payload = {'apikey': apikey, 'path': path, 'guid': download_id, 'mode': 'failed'} payload = {'apikey': apikey, 'path': path, 'guid': download_id, 'mode': 'failed'}
r = requests.post(base_url, data=payload, verify=False, timeout=(30, 1800)) r = requests.post(base_url, data=payload, verify=False, timeout=(30, 1800))
result = r.json() result = r.json()