mirror of https://github.com/evilhero/mylar
Config Fixes
This commit is contained in:
parent
ed55065779
commit
abfd9492be
|
@ -40,7 +40,7 @@ _CONFIG_DEFINITIONS = OrderedDict({
|
||||||
'NEWCOM_DIR': (str, 'General', None),
|
'NEWCOM_DIR': (str, 'General', None),
|
||||||
'FFTONEWCOM_DIR': (bool, 'General', False),
|
'FFTONEWCOM_DIR': (bool, 'General', False),
|
||||||
'FOLDER_SCAN_LOG_VERBOSE': (bool, 'General', False),
|
'FOLDER_SCAN_LOG_VERBOSE': (bool, 'General', False),
|
||||||
'INTERFACE': (str, 'General', None),
|
'INTERFACE': (str, 'General', 'default'),
|
||||||
'CORRECT_METADATA': (bool, 'General', False),
|
'CORRECT_METADATA': (bool, 'General', False),
|
||||||
'MOVE_FILES': (bool, 'General', False),
|
'MOVE_FILES': (bool, 'General', False),
|
||||||
'RENAME_FILES': (bool, 'General', False),
|
'RENAME_FILES': (bool, 'General', False),
|
||||||
|
@ -84,10 +84,10 @@ _CONFIG_DEFINITIONS = OrderedDict({
|
||||||
'BIGGIE_PUB': (int, 'Weekly', 55),
|
'BIGGIE_PUB': (int, 'Weekly', 55),
|
||||||
|
|
||||||
'HTTP_PORT' : (int, 'Interface', 8090),
|
'HTTP_PORT' : (int, 'Interface', 8090),
|
||||||
'HTTP_HOST' : (str, 'Interface', None),
|
'HTTP_HOST' : (str, 'Interface', '0.0.0.0'),
|
||||||
'HTTP_USERNAME' : (str, 'Interface', None),
|
'HTTP_USERNAME' : (str, 'Interface', None),
|
||||||
'HTTP_PASSWORD' : (str, 'Interface', None),
|
'HTTP_PASSWORD' : (str, 'Interface', None),
|
||||||
'HTTP_ROOT' : (str, 'Interface', None),
|
'HTTP_ROOT' : (str, 'Interface', '/'),
|
||||||
'ENABLE_HTTPS' : (bool, 'Interface', False),
|
'ENABLE_HTTPS' : (bool, 'Interface', False),
|
||||||
'HTTPS_CERT' : (str, 'Interface', None),
|
'HTTPS_CERT' : (str, 'Interface', None),
|
||||||
'HTTPS_KEY' : (str, 'Interface', None),
|
'HTTPS_KEY' : (str, 'Interface', None),
|
||||||
|
@ -192,7 +192,7 @@ _CONFIG_DEFINITIONS = OrderedDict({
|
||||||
'SAB_PASSWORD': (str, 'SABnzbd', None),
|
'SAB_PASSWORD': (str, 'SABnzbd', None),
|
||||||
'SAB_APIKEY': (str, 'SABnzbd', None),
|
'SAB_APIKEY': (str, 'SABnzbd', None),
|
||||||
'SAB_CATEGORY': (str, 'SABnzbd', None),
|
'SAB_CATEGORY': (str, 'SABnzbd', None),
|
||||||
'SAB_PRIORITY': (str, 'SABnzbd', None),
|
'SAB_PRIORITY': (str, 'SABnzbd', "Default"),
|
||||||
'SAB_TO_MYLAR': (bool, 'SABnzbd', False),
|
'SAB_TO_MYLAR': (bool, 'SABnzbd', False),
|
||||||
'SAB_DIRECTORY': (str, 'SABnzbd', None),
|
'SAB_DIRECTORY': (str, 'SABnzbd', None),
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ _CONFIG_DEFINITIONS = OrderedDict({
|
||||||
'DOGNZB_VERIFY': (bool, 'DOGnzb', True),
|
'DOGNZB_VERIFY': (bool, 'DOGnzb', True),
|
||||||
|
|
||||||
'NEWZNAB': (bool, 'Newznab', False),
|
'NEWZNAB': (bool, 'Newznab', False),
|
||||||
'EXTRA_NEWZNABS': (str, 'Newznab', None),
|
'EXTRA_NEWZNABS': (str, 'Newznab', ""),
|
||||||
|
|
||||||
'ENABLE_TORZNAB': (bool, 'Torznab', False),
|
'ENABLE_TORZNAB': (bool, 'Torznab', False),
|
||||||
'TORZNAB_NAME': (str, 'Torznab', None),
|
'TORZNAB_NAME': (str, 'Torznab', None),
|
||||||
|
@ -319,6 +319,11 @@ _CONFIG_DEFINITIONS = OrderedDict({
|
||||||
'QBITTORRENT_FOLDER': (str, 'qBittorrent', None),
|
'QBITTORRENT_FOLDER': (str, 'qBittorrent', None),
|
||||||
'QBITTORRENT_STARTONLOAD': (bool, 'qBittorrent', False),
|
'QBITTORRENT_STARTONLOAD': (bool, 'qBittorrent', False),
|
||||||
|
|
||||||
|
'OPDS_ENABLE': (bool, 'OPDS', False),
|
||||||
|
'OPDS_READONLYUSER': (bool, 'OPDS', False),
|
||||||
|
'OPDS_READONLYUSERNAME': (str, 'OPDS', None),
|
||||||
|
'OPDS_READONLYPASSWORD': (str, 'OPDS', None),
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
|
@ -329,9 +334,12 @@ class Config(object):
|
||||||
|
|
||||||
def config_vals(self, update=False):
|
def config_vals(self, update=False):
|
||||||
if update is False:
|
if update is False:
|
||||||
self.config = config.readfp(codecs.open(self._config_file, 'r', 'utf8')) #read(self._config_file)
|
if os.path.isfile(self._config_file):
|
||||||
#check for empty config / new config
|
self.config = config.readfp(codecs.open(self._config_file, 'r', 'utf8')) #read(self._config_file)
|
||||||
count = sum(1 for line in open(self._config_file))
|
#check for empty config / new config
|
||||||
|
count = sum(1 for line in open(self._config_file))
|
||||||
|
else:
|
||||||
|
count = 0
|
||||||
self.newconfig = 7
|
self.newconfig = 7
|
||||||
if count == 0:
|
if count == 0:
|
||||||
CONFIG_VERSION = 0
|
CONFIG_VERSION = 0
|
||||||
|
@ -373,6 +381,7 @@ class Config(object):
|
||||||
except:
|
except:
|
||||||
value = self.argToBool(v[2])
|
value = self.argToBool(v[2])
|
||||||
try:
|
try:
|
||||||
|
|
||||||
if all([v[0] == int, str(value).isdigit()]):
|
if all([v[0] == int, str(value).isdigit()]):
|
||||||
value = int(value)
|
value = int(value)
|
||||||
except:
|
except:
|
||||||
|
@ -602,8 +611,8 @@ class Config(object):
|
||||||
if not mylar.QUIET:
|
if not mylar.QUIET:
|
||||||
logger.warn('Unable to create the log directory. Logging to screen only.')
|
logger.warn('Unable to create the log directory. Logging to screen only.')
|
||||||
|
|
||||||
if not update:
|
# if not update:
|
||||||
logger.fdebug('[Cache Check] Cache directory currently set to : ' + self.CACHE_DIR)
|
# logger.fdebug('[Cache Check] Cache directory currently set to : ' + self.CACHE_DIR)
|
||||||
|
|
||||||
# Put the cache dir in the data dir for now
|
# Put the cache dir in the data dir for now
|
||||||
if not self.CACHE_DIR:
|
if not self.CACHE_DIR:
|
||||||
|
|
Loading…
Reference in New Issue