From fc3a83b42155a7e06bba1f09fd4018c03aeb83fc Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Fri, 18 Mar 2016 18:35:38 +0300 Subject: [PATCH] revert srg70 monster kill --- Libtorrent.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Libtorrent.py b/Libtorrent.py index 8a6fabc..e95c99e 100644 --- a/Libtorrent.py +++ b/Libtorrent.py @@ -125,7 +125,23 @@ class Libtorrent: log('Exception: ' + str(e)) xbmcvfs.delete(torrentFile) return - + if not xbmcvfs.exists(self.torrentFilesPath): + xbmcvfs.mkdirs(self.torrentFilesPath) + newFile = self.torrentFilesPath + self.md5(torrentUrl) + '.torrent' + if newFile != torrentFile: + if xbmcvfs.exists(newFile): + xbmcvfs.delete(newFile) + if not xbmcvfs.exists(newFile): + try: + xbmcvfs.rename(torrentFile, newFile) + except Exception, e: + log('Unable to rename torrent file from %s to %s in Torrent::renameTorrent. Exception: %s' % + (torrentFile, newFile, str(e))) + return + self.torrentFile = newFile + if not self.torrentFileInfo: + e=self.lt.bdecode(xbmcvfs.File(self.torrentFile,'rb').read()) + self.torrentFileInfo = self.lt.torrent_info(e) self.torrentFile = torrentFile return self.torrentFile