add monitor_new_content option

pull/21/head
Leonardo Merza 4 years ago
parent df89b1dc53
commit a5a0c90008

@ -66,6 +66,7 @@ Syncs two Radarr/Sonarr/Lidarr servers through the web API. Useful for syncing a
[general]
sync_bidirectionally = 1 # sync from instance A to B **AND** instance B to A
auto_search = 0 # search is automatically started on new content - disable by setting to 0
monitor_new_content = 0 # set to 0 to never monitor new content synced or to 1 to always monitor new content synced
```
**Note** If `sync_bidirectionally` is set to `1`, then instance A will require either `profile_id` or `profile` AND `path` as well
@ -148,6 +149,7 @@ To filter by profile in docker use `ARR_A_PROFILE_FILTER` or `ARR_A_PROFILE_FILT
* Language for new content (Sonarr v3 only) can be set by `SONARR_B_LANGUAGE` or `SONARR_B_LANGUAGE_ID` (and `SONARR_B` if bidirectional sync)
* Set bidirectional sync with `SYNCARR_BIDIRECTIONAL_SYNC=1`
* Set disable auto searching on new content with `SYNCARR_AUTO_SEARCH=0`
* Set if you wanted to monitor new content with `SYNCARR_MONITOR_NEW_CONTENT=1/0`
---
## Requirements

@ -135,13 +135,17 @@ lidarrB_path = get_config_value('LIDARR_B_PATH', 'path', 'lidarrB')
# get general conf options
sync_bidirectionally = get_config_value(
'SYNCARR_BIDIRECTIONAL_SYNC', 'bidirectional', 'general') or 0
if sync_bidirectionally:
'SYNCARR_BIDIRECTIONAL_SYNC', 'bidirectional', 'general')
if sync_bidirectionally is not None:
sync_bidirectionally = int(sync_bidirectionally)
auto_search = get_config_value(
'SYNCARR_AUTO_SEARCH', 'auto_search', 'general') or 1
if auto_search:
'SYNCARR_AUTO_SEARCH', 'auto_search', 'general')
if auto_search is not None:
auto_search = int(auto_search)
monitor_new_content = get_config_value(
'SYNCARR_MONITOR_NEW_CONTENT', 'monitor_new_content', 'general')
if monitor_new_content is not None:
monitor_new_content = int(monitor_new_content)
########################################################################################################################
@ -370,6 +374,7 @@ logger.debug({
'api_language_path': api_language_path,
'is_sonarr': is_sonarr,
'is_lidarr': is_lidarr,
'monitor_new_content': monitor_new_content,
})
if not instanceA_url:

@ -20,21 +20,27 @@ from config import (
content_id_key, logger, is_sonarr, is_radarr, is_lidarr,
get_status_path, get_content_path, get_search_path, get_profile_path, get_language_path,
is_in_docker, instance_sync_interval_seconds, sync_bidirectionally, auto_search,
tested_api_version, api_version, V3_API_PATH,
is_in_docker, instance_sync_interval_seconds,
sync_bidirectionally, auto_search, monitor_new_content,
tested_api_version, api_version, V3_API_PATH,
)
def get_new_content_payload(content, instance_path, instance_profile_id, instance_url, instance_language_id=None):
global monitor_new_content
images = content.get('images')
for image in images:
image['url'] = '{0}{1}'.format(instance_url, image.get('url'))
monitored = content.get('monitored')
if monitor_new_content is not None:
monitored = True if monitor_new_content else False
payload = {
content_id_key: content.get(content_id_key),
'qualityProfileId': instance_profile_id or content.get('qualityProfileId'),
'monitored': content.get('monitored'),
'monitored': monitored,
'rootFolderPath': instance_path,
'images': images,
}

Loading…
Cancel
Save