forked from sch/Slixfeed
Expose all options except 'check' and 'formatting'.
This commit is contained in:
parent
21cb7df160
commit
4642aa694b
4 changed files with 6 additions and 7 deletions
|
@ -58,12 +58,11 @@ class Config:
|
||||||
# TODO Open SQLite file once
|
# TODO Open SQLite file once
|
||||||
def add_settings_jid(self, jid_bare, db_file):
|
def add_settings_jid(self, jid_bare, db_file):
|
||||||
self.settings[jid_bare] = {}
|
self.settings[jid_bare] = {}
|
||||||
for key in ('archive', 'enabled', 'filter', 'formatting', 'interval',
|
for key in self.defaults['default']:
|
||||||
'length', 'media', 'old', 'quantum'):
|
|
||||||
value = sqlite.get_setting_value(db_file, key)
|
value = sqlite.get_setting_value(db_file, key)
|
||||||
if value:
|
if value:
|
||||||
self.settings[jid_bare][key] = value[0]
|
self.settings[jid_bare][key] = value[0]
|
||||||
elif key != 'formatting':
|
elif key not in ('check', 'formatting'):
|
||||||
# NOTE This might neglects the need for
|
# NOTE This might neglects the need for
|
||||||
# self.defaults of get_setting_value
|
# self.defaults of get_setting_value
|
||||||
self.settings[jid_bare][key] = self.defaults['default'][key]
|
self.settings[jid_bare][key] = self.defaults['default'][key]
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
__version__ = '0.1.91'
|
__version__ = '0.1.92'
|
||||||
__version_info__ = (0, 1, 91)
|
__version_info__ = (0, 1, 92)
|
||||||
|
|
|
@ -379,7 +379,7 @@ class XmppPubsubTask:
|
||||||
async def task_publish(self, jid_bare):
|
async def task_publish(self, jid_bare):
|
||||||
db_file = config.get_pathname_to_database(jid_bare)
|
db_file = config.get_pathname_to_database(jid_bare)
|
||||||
if jid_bare not in self.settings:
|
if jid_bare not in self.settings:
|
||||||
Config.add_settings_jid(self.settings, jid_bare, db_file)
|
Config.add_settings_jid(self, jid_bare, db_file)
|
||||||
while True:
|
while True:
|
||||||
await XmppPubsubAction.send_unread_items(self, jid_bare)
|
await XmppPubsubAction.send_unread_items(self, jid_bare)
|
||||||
await asyncio.sleep(60 * 180)
|
await asyncio.sleep(60 * 180)
|
||||||
|
|
|
@ -28,7 +28,7 @@ class XmppStatus:
|
||||||
logger.debug('{}: jid: {}'.format(function_name, jid_bare))
|
logger.debug('{}: jid: {}'.format(function_name, jid_bare))
|
||||||
status_text = '📜️ Slixfeed RSS News Bot'
|
status_text = '📜️ Slixfeed RSS News Bot'
|
||||||
db_file = config.get_pathname_to_database(jid_bare)
|
db_file = config.get_pathname_to_database(jid_bare)
|
||||||
enabled = Config.get_setting_value(self.settings, jid_bare, 'enabled')
|
enabled = Config.get_setting_value(self, jid_bare, 'enabled')
|
||||||
if enabled:
|
if enabled:
|
||||||
jid_task = self.pending_tasks[jid_bare] if jid_bare in self.pending_tasks else None
|
jid_task = self.pending_tasks[jid_bare] if jid_bare in self.pending_tasks else None
|
||||||
if jid_task and len(jid_task):
|
if jid_task and len(jid_task):
|
||||||
|
|
Loading…
Reference in a new issue