speed and clear fix
parent
b5d481992c
commit
3cf3a3eaed
10
Player.py
10
Player.py
|
@ -177,11 +177,13 @@ class TorrentPlayer(xbmc.Player):
|
|||
|
||||
def setup_torrent(self):
|
||||
self.torrent.startSession()
|
||||
if 0 < int(self.__settings__.getSetting("upload_limit")):
|
||||
self.torrent.setUploadLimit(int(self.__settings__.getSetting("upload_limit")) * 1000000 / 8) #MBits/second
|
||||
if 0 < int(self.__settings__.getSetting("download_limit")):
|
||||
upload_limit=self.__settings__.getSetting("upload_limit") if self.__settings__.getSetting("upload_limit")!="" else 0
|
||||
if 0 < int(upload_limit):
|
||||
self.torrent.setUploadLimit(int(upload_limit) * 1000000 / 8) #MBits/second
|
||||
download_limit=self.__settings__.getSetting("download_limit") if self.__settings__.getSetting("download_limit")!="" else 0
|
||||
if 0 < int(download_limit):
|
||||
self.torrent.setDownloadLimit(
|
||||
int(self.__settings__.getSetting("download_limit")) * 1000000 / 8) #MBits/second
|
||||
int(download_limit) * 1000000 / 8) #MBits/second
|
||||
self.torrent.status = False
|
||||
self.fullSize = self.torrent.getFileSize(self.contentId)
|
||||
Offset = calculate(self.fullSize)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="plugin.video.torrenter" name="Torrenter" version="2.1.8" provider-name="vadim.skorba, DiMartino">
|
||||
<addon id="plugin.video.torrenter" name="Torrenter" version="2.1.9" provider-name="vadim.skorba, DiMartino">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="2.1.0"/>
|
||||
<import addon="script.module.libtorrent"/>
|
||||
|
|
|
@ -50,10 +50,14 @@ def clearStorage(userStorageDirectory):
|
|||
import shutil
|
||||
|
||||
temp = userStorageDirectory.rstrip('Torrenter').rstrip('/\\')
|
||||
shutil.move(os.path.join(userStorageDirectory, 'torrents'), os.path.join(temp, 'torrents'))
|
||||
torrents_temp,i=None,0
|
||||
while not torrents_temp or xbmcvfs.exists(torrents_temp):
|
||||
torrents_temp=os.path.join(temp, 'torrents'+str(i))+os.sep
|
||||
i+=1
|
||||
shutil.move(os.path.join(userStorageDirectory, 'torrents'), torrents_temp)
|
||||
shutil.rmtree(userStorageDirectory, ignore_errors=True)
|
||||
xbmcvfs.mkdir(userStorageDirectory)
|
||||
shutil.move(os.path.join(temp, 'torrents'), os.path.join(userStorageDirectory, 'torrents'))
|
||||
shutil.move(torrents_temp, os.path.join(userStorageDirectory, 'torrents'))
|
||||
DownloadDB().clear()
|
||||
showMessage(Localization.localize('Storage'), Localization.localize('Storage was cleared'), forced=True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue