Skip to content

Commit

Permalink
proper sickrage settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Higgins committed Mar 4, 2015
1 parent 86458da commit 5dd41f6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
12 changes: 6 additions & 6 deletions autoprocess/autoProcessTVSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
from urllib.parse import urlencode

def processEpisode(dir_to_process, settings, org_NZB_name=None, status=None):
host = settings.Sickbeard['host']
port = settings.Sickbeard['port']
username = settings.Sickbeard['user']
password = settings.Sickbeard['pass']
host = settings.Sickrage['host']
port = settings.Sickrage['port']
username = settings.Sickrage['user']
password = settings.Sickrage['pass']

try:
ssl = int(settings.Sickbeard['ssl'])
ssl = int(settings.Sickrage['ssl'])
except:
ssl = 0

try:
web_root = settings.Sickbeard['web_root']
web_root = settings.Sickrage['web_root']
if not web_root.startswith("/"):
web_root = "/" + web_root
if not web_root.endswith("/"):
Expand Down
22 changes: 21 additions & 1 deletion readSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,16 @@ def __init__(self, directory, filename):
'Couchpotato-category': 'couchpotato',
'Sonarr-category': 'sonarr',
'Bypass-category': 'bypass' }
# Default Sickrage Settings
sr_defaults = {'host': 'localhost',
'port': '8081',
'ssl': "False",
'api_key': '',
'web_root': '',
'user': '',
'pass': '' }

defaults = {'SickBeard': sb_defaults, 'CouchPotato': cp_defaults, 'Sonarr': sonarr_defaults, 'MP4': mp4_defaults, 'uTorrent': utorrent_defaults, 'SABNZBD': sab_defaults}
defaults = {'SickBeard': sb_defaults, 'CouchPotato': cp_defaults, 'Sonarr': sonarr_defaults, 'MP4': mp4_defaults, 'uTorrent': utorrent_defaults, 'SABNZBD': sab_defaults, 'Sickrage', sr_defaults}
write = False # Will be changed to true if a value is missing from the config file and needs to be written

config = ConfigParser.SafeConfigParser()
Expand Down Expand Up @@ -353,6 +361,18 @@ def __init__(self, directory, filename):
self.Sickbeard['user'] = config.get(section, "username")
self.Sickbeard['pass'] = config.get(section, "password")

#Read Sickrage section information
section = "Sickrage"
self.Sickrage = {}
self.Sickrage['host'] = config.get(section, "host") # Server Address
self.Sickrage['port'] = config.get(section, "port") # Server Port
self.Sickrage['api_key'] = config.get(section, "api_key") # Sickbeard API key
self.Sickrage['web_root'] = config.get(section, "web_root") # Sickbeard webroot
self.Sickrage['ssl'] = config.getboolean(section, "ssl") # SSL
self.Sickrage['user'] = config.get(section, "username")
self.Sickrage['pass'] = config.get(section, "password")

#Read SAB section information
section = "SABNZBD"
self.SAB = {}
try:
Expand Down

0 comments on commit 5dd41f6

Please sign in to comment.