API update and skin

pull/1/head
DiMartinoXBMC 2016-03-02 19:46:17 +03:00
parent e335f8e984
commit 30b158e155
8 changed files with 506 additions and 503 deletions

File diff suppressed because it is too large Load Diff

106
Core.py
View File

@ -242,7 +242,24 @@ class Core:
def test(self, params={}): def test(self, params={}):
#from Anteoloader import AnteoPlayer #from Anteoloader import AnteoPlayer
#torrentUrl='D:\\test.torrent' #from python_libtorrent import get_libtorrent
#self.lt=get_libtorrent()
#self.torrentFile='D:\\test.torrent'
#self.session = self.lt.session()
#e=self.lt.bdecode(xbmcvfs.File(self.torrentFile,'rb').read())
#self.torrentFileInfo = self.lt.torrent_info(e)
#torrent_info={'ti': self.torrentFileInfo,
# 'save_path': self.userStorageDirectory,
# 'flags': 0x300,
# #'storage_mode': self.lt.storage_mode_t(1),
# 'paused': False,
# #'auto_managed': False,
# #'duplicate_is_error': True
# }
#self.torrentHandle = self.session.add_torrent(torrent_info)
#log(self.torrentHandle.torrent_file())
#self.session.remove_torrent(self.torrentHandle)
#params['url']='0' #params['url']='0'
#if not xbmcvfs.exists(torrentUrl): #if not xbmcvfs.exists(torrentUrl):
# action = xbmcgui.Dialog() # action = xbmcgui.Dialog()
@ -258,93 +275,6 @@ class Core:
# xbmc.sleep(1000) # xbmc.sleep(1000)
# self.Downloader.__exit__() # self.Downloader.__exit__()
#self.Player = AnteoPlayer(userStorageDirectory=self.userStorageDirectory, torrentUrl=torrentUrl, params=params) #self.Player = AnteoPlayer(userStorageDirectory=self.userStorageDirectory, torrentUrl=torrentUrl, params=params)
log('userStorageDirectory - '+(self.userStorageDirectory))
log('is_writable - '+str(is_writable(self.userStorageDirectory)))
log('getsize - '+str(os.path.getsize(self.userStorageDirectory)))
log('getDirectorySizeInBytes - '+str(getDirectorySizeInBytes(self.userStorageDirectory)))
log('getDirectorySizeInGB - '+str(getDirectorySizeInGB(self.userStorageDirectory)))
import stat
try:
log(os.popen("DIR").read())
except Exception, e:
log('lol didnt work')
log(str(e))
try:
log(os.popen("cd %s; ls -la" % os.path.dirname(self.userStorageDirectory)).read())
except Exception, e:
log('lol didnt work2')
log(str(e))
try:
log(os.popen("cd %s; ls -la" % self.userStorageDirectory).read())
except Exception, e:
log('lol didnt work3')
log(str(e))
try:
log(os.popen("id; chmod 777 %s" % self.userStorageDirectory).read())
except Exception, e:
log('lol didnt work3')
log(str(e))
#try:
# log(os.popen("cd %s; df -h" % self.userStorageDirectory).read())
#except Exception, e:
# log('lol didnt work2')
# log(str(e))
try:
log(str(os.path.isdir(self.userStorageDirectory)))
except Exception, e:
log(str(e))
try:
log(str(os.path.exists(self.userStorageDirectory)))
except Exception, e:
log(str(e))
try:
log(str(os.listdir(self.userStorageDirectory)))
except Exception, e:
log(str(e))
try:
log(str(os.listdir(os.path.dirname(self.userStorageDirectory))))
except Exception, e:
log(str(e))
try:
os.makedirs(os.path.join(self.userStorageDirectory, 'xtorrents'))
except Exception, e:
log(str(e))
try:
os.chmod(os.path.dirname(self.userStorageDirectory), stat.S_IWOTH)
except Exception, e:
log(str(e))
try:
os.chmod(self.userStorageDirectory, stat.S_IWOTH)
except Exception, e:
log(str(e))
try:
log(str(os.path.isdir(self.userStorageDirectory)))
except Exception, e:
log(str(e))
try:
log(os.popen("cd %s; ls -la" % os.path.dirname(self.userStorageDirectory)).read())
torrentFile = os.path.join(self.userStorageDirectory, 'shiiiiit')
localFile = xbmcvfs.File(torrentFile, "w+b")
localFile.write('HELLO')
localFile.close()
except Exception, e:
log('lol didnt work2')
log(str(e))
try:
log(str(os.listdir(self.userStorageDirectory)))
except Exception, e:
log(str(e))
xbmcgui.Dialog().ok('Dam Son!','Now send this shit to DiMartino') xbmcgui.Dialog().ok('Dam Son!','Now send this shit to DiMartino')

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.torrenter" name="Torrenter" version="2.4.5" provider-name="DiMartino"> <addon id="plugin.video.torrenter" name="Torrenter" version="2.4.6" provider-name="DiMartino">
<requires> <requires>
<import addon="xbmc.python" version="2.1.0"/> <import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.libtorrent"/> <import addon="script.module.libtorrent"/>

View File

@ -3,6 +3,7 @@
[B]Version 2.4.6[/B] [B]Version 2.4.6[/B]
[+] Проигрыватель: Уменьшена просадка после загрузки буфера (спасибо srg70 и RussakHH) [+] Проигрыватель: Уменьшена просадка после загрузки буфера (спасибо srg70 и RussakHH)
[+] История Просмотров: Добавлено имя раздачи, тонкая настройка добавления по проценту просмотра [+] История Просмотров: Добавлено имя раздачи, тонкая настройка добавления по проценту просмотра
[+] API: Внешние управление из любого плагина
[B]Version 2.4.5[/B] [B]Version 2.4.5[/B]
[+] Дополнительна секция настроек со специфическими опциями [+] Дополнительна секция настроек со специфическими опциями

View File

@ -572,7 +572,7 @@ def view_style(func):
styles['sectionMenu'] = styles['Seasons'] = 'list' styles['sectionMenu'] = styles['Seasons'] = 'list'
styles['uTorrentBrowser'] = styles['torrentPlayer'] = styles['openTorrent'] = 'wide' styles['uTorrentBrowser'] = styles['torrentPlayer'] = styles['openTorrent'] = 'wide'
styles['showFilesList'] = styles['DownloadStatus'] = 'wide' styles['showFilesList'] = styles['DownloadStatus'] = 'wide'
elif view_style in [1, 4]: elif view_style in [1, 4, 5]:
styles['searchOption'] = 'info' styles['searchOption'] = 'info'
styles['drawContent'] = styles['torrentPlayer'] = styles['openTorrent'] = styles['drawtrackerList'] = 'info' styles['drawContent'] = styles['torrentPlayer'] = styles['openTorrent'] = styles['drawtrackerList'] = 'info'
styles['uTorrentBrowser'] = styles['History'] = styles['DownloadStatus'] = 'wide' styles['uTorrentBrowser'] = styles['History'] = styles['DownloadStatus'] = 'wide'
@ -583,8 +583,13 @@ def view_style(func):
styles['uTorrentBrowser'] = styles['torrentPlayer'] = 'wide' styles['uTorrentBrowser'] = styles['torrentPlayer'] = 'wide'
styles['openTorrent'] = styles['History'] = styles['DownloadStatus'] = 'wide' styles['openTorrent'] = styles['History'] = styles['DownloadStatus'] = 'wide'
styles['sectionMenu'] = 'icons' styles['sectionMenu'] = 'icons'
elif view_style == 5:
styles['uTorrentBrowser'] = styles['torrentPlayer'] = 'wide'
styles['openTorrent'] = styles['History'] = styles['DownloadStatus'] = 'wide'
styles['drawtrackerList'] = styles['drawContent'] = styles['List'] = styles['sectionMenu'] = 'icons'
styles['searchOption'] = 'info'
if view_style in [1, 3, 4]: if view_style in [1, 3, 4, 5]:
num_skin = 0 num_skin = 0
elif view_style == 2: elif view_style == 2:
num_skin = 1 num_skin = 1

View File

@ -63,6 +63,7 @@
<string id="30063">Do not sort</string> <string id="30063">Do not sort</string>
<string id="30064">by Name</string> <string id="30064">by Name</string>
<string id="30065">Do not add to Watched History if played more (%)</string> <string id="30065">Do not add to Watched History if played more (%)</string>
<string id="30066">Confluence (by safonov_ivan)</string>
<string id="30101">Interface</string> <string id="30101">Interface</string>
<string id="30102">P2P Network</string> <string id="30102">P2P Network</string>
<string id="30103">Advanced</string> <string id="30103">Advanced</string>

View File

@ -63,6 +63,7 @@
<string id="30063">Не сортировать</string> <string id="30063">Не сортировать</string>
<string id="30064">по Имени</string> <string id="30064">по Имени</string>
<string id="30065">Не добавлять в История Просмотров если больше (%)</string> <string id="30065">Не добавлять в История Просмотров если больше (%)</string>
<string id="30066">Confluence (от safonov_ivan)</string>
<string id="30101">Интерфейс</string> <string id="30101">Интерфейс</string>
<string id="30102">P2P Сеть</string> <string id="30102">P2P Сеть</string>
<string id="30103">Дополнительные</string> <string id="30103">Дополнительные</string>

View File

@ -4,7 +4,7 @@
<setting id="metadata" type="bool" label="30014" default="false"/> <setting id="metadata" type="bool" label="30014" default="false"/>
<setting id="history" type="bool" label="30020" default="true"/> <setting id="history" type="bool" label="30020" default="true"/>
<setting id="sort_search" type="enum" label="30061" default="0" lvalues="30062|30063|30064"/> <setting id="sort_search" type="enum" label="30061" default="0" lvalues="30062|30063|30064"/>
<setting id="skin_optimization" type="enum" label="30002" default="1" lvalues="30003|30018|30017|30016|30019"/> <setting id="skin_optimization" type="enum" label="30002" default="1" lvalues="30003|30018|30017|30016|30019|30066"/>
<setting id="open_option" type="enum" label="30034" default="0" lvalues="30035|30036|30037|30038"/> <setting id="open_option" type="enum" label="30034" default="0" lvalues="30035|30036|30037|30038"/>
</category> </category>
<category label="30103"> <category label="30103">