если исключения - возвращаем False

master
Бородин Роман 2019-05-05 14:12:40 +03:00
parent 4ec38a5c13
commit f8ac0c159d
2 changed files with 90 additions and 78 deletions

View File

@ -34,6 +34,7 @@ def root(plugin, content_type='video'):
))
@Route.register
def search_history(plugin):
try:
@Route.register_delayed
def set_view():
xbmc.executebuiltin('Container.SetViewMode("51")')
@ -44,6 +45,8 @@ def search_history(plugin):
yield item
else:
yield None
except:
yield False
@Route.register
def new_search(plugin):
q = utils.keyboard('Поиск')
@ -52,6 +55,7 @@ def new_search(plugin):
return search(plugin, q)
@Route.register
def search(plugin, search_query, thumb=None):
try:
@Route.register_delayed
def set_view():
xbmc.executebuiltin('Container.SetViewMode("51")')
@ -83,8 +87,11 @@ def search(plugin, search_query, thumb=None):
res_items.append(item)
progress.close()
return res_items
except:
return False
@Route.register
def open_torrent(plugin, url='--back--', cookies={}, referer='', path=''):
try:
if url == '--back--':
xbmc.executebuiltin('ActivateWindow("home")')
yield False
@ -120,10 +127,15 @@ def open_torrent(plugin, url='--back--', cookies={}, referer='', path=''):
yield item
else:
yield None
except:
yield False
@Route.register
def play_file(plugin, t_full_path, f_index):
try:
vl = VideoLoop(t_full_path)
vl.start(f_index)
return False
except:
return False
if __name__ == '__main__':
run()

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.torrenter3" name="Torrenter3" provider-name="inpos" version="3.0.3">
<addon id="plugin.video.torrenter3" name="Torrenter3" provider-name="inpos" version="3.0.4">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.pyrrent2http"/>