Skip to content

Commit

Permalink
v1.0.12
Browse files Browse the repository at this point in the history
Co-Authored-By: reyterak <reyterak@users.noreply.github.com>
  • Loading branch information
IIeTp and ReyterAK committed Jun 21, 2020
1 parent 0d4c46d commit 3282b04
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
FileBotMod = filebot_is(Prefs['xattr_id'])
if FileBotMod != False:
from filebot import *
Log('FileBot Xattr is founded')
FileBot = True
else:
FileBot = False
Expand Down Expand Up @@ -54,8 +55,8 @@

####################################################################################################
def Start():
if Prefs['auto_update'] != 'none':
Thread.CreateTimer(int(Prefs['update_interval'] or 1)*60, Updater.auto_update_thread, core=Core, pref=Prefs)
if Prefs['auto_update'] == True:
Thread.CreateTimer(3600, Updater.auto_update_thread, core=Core)

def ValidatePrefs():
Log('ValidatePrefs function call')
Expand Down
8 changes: 1 addition & 7 deletions Contents/DefaultPrefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,5 @@
"label":"Auto update plugin",
"type":"bool",
"default":"true"
},
{
"id": "update_interval",
"label": "Update check interval (in minutes)",
"type": "text",
"default": "60"
}
}
]
8 changes: 4 additions & 4 deletions Contents/Libraries/Shared/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Updater(object):
def __init__(self, core, channel, repo='IIeTp'):
self._core = core
self._channel = channel
self._channel = 'stable'
self._repo = repo
self.identifier = self._core.identifier
self.stage = self._core.storage.data_item_path('Stage')
Expand All @@ -25,17 +25,17 @@ def __init__(self, core, channel, repo='IIeTp'):
self.archive_url = 'https://github.com/%s/TheMovieDB.ID.bundle/archive/%s.zip'

@classmethod
def auto_update_thread(cls, core, pref):
def auto_update_thread(cls, core):
try:
cls(core,'stable').checker()
core.storage.remove_data_item('error_update')
except Exception as e:
core.storage.save_data_item('error_update', str(e))

core.runtime.create_timer(int(pref['update_interval'] or 1)*60, Updater.auto_update_thread, True, core.sandbox, True, core=core, pref=pref)
core.runtime.create_timer(3600, Updater.auto_update_thread, True, core.sandbox, True, core=core)

def checker(self):
self._core.log.debug('Check for channel %s updates', self._channel)
self._core.log.debug('Check for plugin updates')
url = self.stable_url
req = self._core.networking.http_request(url)
if req:
Expand Down
2 changes: 1 addition & 1 deletion Contents/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.11
v1.0.12

0 comments on commit 3282b04

Please sign in to comment.