Merge remote-tracking branch 'origin/master'

pull/15/head
DiMartinoXBMC 2016-12-29 20:45:00 +03:00
commit d840712e34
2 changed files with 7 additions and 6 deletions

View File

@ -30,7 +30,7 @@ class Core:
__plugin__ = sys.modules["__main__"].__plugin__
__settings__ = sys.modules["__main__"].__settings__
ROOT = sys.modules["__main__"].__root__
userStorageDirectory = localize_path(__settings__.getSetting("storage"))#file_encode(__settings__.getSetting("storage"))
userStorageDirectory = localize_path(xbmc.translatePath(__settings__.getSetting("storage")))#file_encode(__settings__.getSetting("storage"))
torrentFilesDirectory = 'torrents'
debug = __settings__.getSetting('debug') == 'true'
torrent_player = __settings__.getSetting("torrent_player")
@ -1397,6 +1397,7 @@ class Core:
self.__settings__.setSetting("lastTorrent", torrent.saveTorrent(url))
self.__settings__.setSetting("lastTorrentUrl", url)
if url:
xbmc.executebuiltin("Dialog.Close(all,true)")
xbmc.executebuiltin(
'XBMC.ActivateWindow(%s)' % 'Videos,plugin://plugin.video.torrenter/?action=%s&url=%s'
% ('torrentPlayer', url))
@ -1455,9 +1456,9 @@ class Core:
#xbmc.executebuiltin('xbmc.RunPlugin("plugin://plugin.video.yatp/?action=play&torrent=%s&file_index=%s")' % (urllib.quote_plus(torrentUrl), params['url']))
elif self.torrent_player == '1':
__ASsettings__ = xbmcaddon.Addon(id='script.module.torrent.ts')
folder=__ASsettings__.getSetting("folder")
folder=__ASsettings__.getSetting("path")
save=__ASsettings__.getSetting("save")
__ASsettings__.setSetting("folder", self.__settings__.getSetting("storage"))
__ASsettings__.setSetting("path", xbmc.translatePath(self.__settings__.getSetting("storage")))
__ASsettings__.setSetting("save", self.__settings__.getSetting("keep_files"))
xbmc.sleep(1000)
torrent = Downloader.Torrent(self.userStorageDirectory, torrentUrl, self.torrentFilesDirectory)
@ -1468,7 +1469,7 @@ class Core:
label = unquote(get("label"), os.path.basename(path))
torrent.play_url_ind(int(ind), label, icon)
torrent.__exit__()
__ASsettings__.setSetting("folder", folder)
__ASsettings__.setSetting("path", folder)
__ASsettings__.setSetting("save", save)
def saveUrlTorrent(self, url):

View File

@ -43,7 +43,7 @@ except:
__settings__ = xbmcaddon.Addon(id='plugin.video.torrenter')
__language__ = __settings__.getLocalizedString
ROOT = __settings__.getAddonInfo('path') # .decode('utf-8').encode(sys.getfilesystemencoding())
userStorageDirectory = __settings__.getSetting("storage")
userStorageDirectory = xbmc.translatePath(__settings__.getSetting("storage"))
torrentFilesDirectory = 'torrents'
USERAGENT = "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0"
__addonpath__ = __settings__.getAddonInfo('path')
@ -2265,4 +2265,4 @@ def get_item():
})
item.setInfo(type='Video', infoLabels=infoLabels)
return item
return item