From 7b7bdd1c6ac14b667b0ddf0e37a7738b2042899a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D1=80=D0=BE=D0=B4=D0=B8=D0=BD=20=D0=A0=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD?= Date: Sat, 26 May 2018 11:08:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B7=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D1=83=D0=B7=D0=BA=D0=B0=20=D0=BF=D1=83=D1=81=D1=82=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20torrent-=D1=84=D0=B0=D0=B9=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Core.py b/Core.py index 82302d1..39a8067 100644 --- a/Core.py +++ b/Core.py @@ -556,9 +556,11 @@ class Core: if action2 == 'open': filename, foldername, path, url, seek, length, ind = db.get('filename, foldername, path, url, seek, length, ind', 'addtime', str(addtime)) - if os.path.exists(path): + if os.path.exists(path) and os.path.getsize(path) > 0: self.__settings__.setSetting("lastTorrent", path) else: + if os.path.exists(path): + os.unlink(path) torrent = Downloader.Torrent(self.userStorageDirectory, torrentFilesDirectory=self.torrentFilesDirectory) path = torrent.saveTorrent(url) self.__settings__.setSetting("lastTorrent", path) @@ -574,9 +576,11 @@ class Core: seek = int(seek) else: seek = 0 - if os.path.exists(path): + if os.path.exists(path) and os.path.getsize(path) > 0: self.__settings__.setSetting("lastTorrent", path) else: + if os.path.exists(path): + os.unlink(path) torrent = Downloader.Torrent(self.userStorageDirectory, torrentFilesDirectory=self.torrentFilesDirectory) self.__settings__.setSetting("lastTorrent", torrent.saveTorrent(url)) xbmc.executebuiltin('xbmc.RunPlugin("plugin://plugin.video.torrenter/?action=playTorrent&url='+str(ind)+'&seek='+str(seek)+'")')