Skip to content

Commit

Permalink
Merge pull request #145 from codingPF/UpdateCheckInterval
Browse files Browse the repository at this point in the history
Make the update check interval a setting parameter #140, #131
  • Loading branch information
alex1702 authored Apr 29, 2020
2 parents 0a83fe6 + c1086e1 commit d17cdff
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions resources/language/resource.language.de_de/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ msgctxt "#30117"
msgid "Recent calculated by"
msgstr "Neuigkeit berechnet ab"

msgctxt "#30118"
msgid "Up-to-Date check interval [sec]"
msgstr "Nach Updates suchen alle [sec]"

msgctxt "#30171"
msgid "Aired Date"
msgstr "Sendedatum"
Expand Down
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ msgctxt "#30117"
msgid "Recent calculated by"
msgstr "Recent calculated by"

msgctxt "#30118"
msgid "Up-to-Date check interval [sec]"
msgstr "Up-to-Date check interval [sec]"

msgctxt "#30171"
msgid "Aired Date"
msgstr "Aired Date"
Expand Down
4 changes: 4 additions & 0 deletions resources/language/resource.language.it_it/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ msgctxt "#30117"
msgid "Recent calculated by"
msgstr "Novità calcolate con"

msgctxt "#30118"
msgid "Up-to-Date check interval [sec]"
msgstr "intervallo di controllo [sec]"

msgctxt "#30171"
msgid "Aired Date"
msgstr "Data di Trasmissione"
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def run(self):
self.settings.save_update_instance(self.monitor.instance_id)
self.updater.update(False)
# Sleep/wait for abort for 60 seconds
if self.monitor.wait_for_abort(15):
if self.monitor.wait_for_abort(self.settings.updateCheckInterval):
# Abort was requested while waiting. We should exit
break
self.info('Shutting down... (instance id: {})',
Expand Down
1 change: 1 addition & 0 deletions resources/lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def load(self):
self.maxresults = int(addon.getSetting('maxresults'))
self.maxage = int(addon.getSetting('maxage')) * 86400
self.recentmode = int(addon.getSetting('recentmode'))
self.updateCheckInterval = int(addon.getSetting('updateCheckInterval'))
# database
self.type = int(addon.getSetting('dbtype'))
self.host = addon.getSetting('dbhost')
Expand Down
1 change: 1 addition & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<setting id="maxresults" type="slider" label="30115" default="1000" range="100,100,3000" option="int" />
<setting id="maxage" type="slider" label="30116" default="2" range="1,30" option="int" />
<setting id="recentmode" type="enum" label="30117" default="0" lvalues="30171|30172" />
<setting id="updateCheckInterval" type="slider" label="30118" default="15" range="15,600" option="int" />
</category>
<category label="30002">
<setting id="dbtype" type="enum" label="30210" default="0" lvalues="30221|30222" />
Expand Down

0 comments on commit d17cdff

Please sign in to comment.