log fixes
parent
8300a00adc
commit
b018d83178
16
Core.py
16
Core.py
|
@ -376,16 +376,16 @@ class Core:
|
||||||
progress=int(jsoninfo.get('progress'))
|
progress=int(jsoninfo.get('progress'))
|
||||||
if status=='pause':
|
if status=='pause':
|
||||||
status_sign='[||]'
|
status_sign='[||]'
|
||||||
img=self.ROOT + '/icons/pause-icon.png'
|
img = os.path.join(self.ROOT, '/icons/', 'pause-icon.png')
|
||||||
elif status=='stopped':
|
elif status=='stopped':
|
||||||
status_sign='[X]'
|
status_sign='[X]'
|
||||||
img=self.ROOT + '/icons/stop-icon.png'
|
img = os.path.join(self.ROOT, '/icons/', 'stop-icon.png')
|
||||||
else:
|
else:
|
||||||
status_sign='[>]'
|
status_sign='[>]'
|
||||||
if progress==100:
|
if progress==100:
|
||||||
img=self.ROOT + '/icons/upload-icon.png'
|
img = os.path.join(self.ROOT, '/icons/', 'upload-icon.png')
|
||||||
else:
|
else:
|
||||||
img=self.ROOT + '/icons/download-icon.png'
|
img = os.path.join(self.ROOT, '/icons/', 'download-icon.png')
|
||||||
|
|
||||||
title = '[%d%%]%s %s' % (progress, status_sign, title)
|
title = '[%d%%]%s %s' % (progress, status_sign, title)
|
||||||
if jsoninfo.get('seeds')!=None and jsoninfo.get('peers')!=None and \
|
if jsoninfo.get('seeds')!=None and jsoninfo.get('peers')!=None and \
|
||||||
|
@ -1147,10 +1147,10 @@ class Core:
|
||||||
status = TextBB(' [||] ', 'b')
|
status = TextBB(' [||] ', 'b')
|
||||||
elif data['status'] in ('seeding', 'downloading'):
|
elif data['status'] in ('seeding', 'downloading'):
|
||||||
status = TextBB(' [>] ', 'b')
|
status = TextBB(' [>] ', 'b')
|
||||||
if data['status']=='seed_pending':img=self.ROOT + '/icons/pause-icon.png'
|
if data['status'] == 'seed_pending': os.path.join(self.ROOT, '/icons/', 'pause-icon.png')
|
||||||
elif data['status']=='stopped': img=self.ROOT + '/icons/stop-icon.png'
|
elif data['status'] == 'stopped': os.path.join(self.ROOT, '/icons/', 'stop-icon.png')
|
||||||
elif data['status']=='seeding':img=self.ROOT + '/icons/upload-icon.png'
|
elif data['status'] == 'seeding': os.path.join(self.ROOT, '/icons/', 'upload-icon.png')
|
||||||
elif data['status']=='downloading':img=self.ROOT + '/icons/download-icon.png'
|
elif data['status'] == 'downloading': os.path.join(self.ROOT, '/icons/', 'download-icon.png')
|
||||||
menu.append(
|
menu.append(
|
||||||
{"title": '[' + str(data['progress']) + '%]' + status + data['name'] + ' [' + str(
|
{"title": '[' + str(data['progress']) + '%]' + status + data['name'] + ' [' + str(
|
||||||
data['ratio']) + ']', "image":img,
|
data['ratio']) + ']', "image":img,
|
||||||
|
|
|
@ -313,7 +313,7 @@ def localize(text):
|
||||||
'Torrent Downloading': 'Завантаження торренту',
|
'Torrent Downloading': 'Завантаження торренту',
|
||||||
'Auth expired, please relogin': 'Авторизація сплила, будь ласка, увійдіть знову',
|
'Auth expired, please relogin': 'Авторизація сплила, будь ласка, увійдіть знову',
|
||||||
'Storage': 'Сховище',
|
'Storage': 'Сховище',
|
||||||
'Storage was cleared': 'Сховище очищене',
|
'Storage has been cleared': 'Сховище очищене',
|
||||||
'Clear Storage': 'Очистити сховище',
|
'Clear Storage': 'Очистити сховище',
|
||||||
'Popular': 'Популярне',
|
'Popular': 'Популярне',
|
||||||
'Views': 'Перегляди',
|
'Views': 'Перегляди',
|
||||||
|
|
|
@ -355,6 +355,7 @@ class TorrentPlayer(xbmc.Player):
|
||||||
|
|
||||||
if response:
|
if response:
|
||||||
# xbmc.Player().play(path, listitem)
|
# xbmc.Player().play(path, listitem)
|
||||||
|
log('Megakostil worked! Start playing '+str(path))
|
||||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||||
playlist.clear()
|
playlist.clear()
|
||||||
playlist.add(path, listitem)
|
playlist.add(path, listitem)
|
||||||
|
|
|
@ -46,7 +46,7 @@ ROOT = __settings__.getAddonInfo('path') # .decode('utf-8').encode(sys.getfiles
|
||||||
userStorageDirectory = __settings__.getSetting("storage")
|
userStorageDirectory = __settings__.getSetting("storage")
|
||||||
USERAGENT = "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0"
|
USERAGENT = "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0"
|
||||||
__addonpath__ = __settings__.getAddonInfo('path')
|
__addonpath__ = __settings__.getAddonInfo('path')
|
||||||
icon = __addonpath__ + '/icon.png'
|
icon = os.path.join(__addonpath__, '/icon.png')
|
||||||
__version__ = __settings__.getAddonInfo('version')
|
__version__ = __settings__.getAddonInfo('version')
|
||||||
__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__
|
__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__
|
||||||
|
|
||||||
|
@ -73,11 +73,11 @@ def clearStorage(userStorageDirectory):
|
||||||
torrents_bool, saved_bool = False, False
|
torrents_bool, saved_bool = False, False
|
||||||
|
|
||||||
if os.path.exists(torrents):
|
if os.path.exists(torrents):
|
||||||
torrents_bool = shutil.move(torrents, torrents_temp)
|
shutil.move(torrents, torrents_temp)
|
||||||
torrents_bool = True
|
torrents_bool = True
|
||||||
|
|
||||||
if os.path.exists(saved):
|
if os.path.exists(saved):
|
||||||
saved_bool = shutil.move(saved, saved_temp)
|
shutil.move(saved, saved_temp)
|
||||||
saved_bool = True
|
saved_bool = True
|
||||||
|
|
||||||
shutil.rmtree(userStorageDirectory, ignore_errors=True)
|
shutil.rmtree(userStorageDirectory, ignore_errors=True)
|
||||||
|
@ -88,7 +88,7 @@ def clearStorage(userStorageDirectory):
|
||||||
if saved_bool:
|
if saved_bool:
|
||||||
shutil.move(saved_temp, saved)
|
shutil.move(saved_temp, saved)
|
||||||
|
|
||||||
showMessage(Localization.localize('Storage'), Localization.localize('Storage was cleared'), forced=True)
|
showMessage(Localization.localize('Storage'), Localization.localize('Storage has been cleared'), forced=True)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
showMessage(Localization.localize('Storage'), Localization.localize('Does not exists'), forced=True)
|
showMessage(Localization.localize('Storage'), Localization.localize('Does not exists'), forced=True)
|
||||||
|
|
Loading…
Reference in New Issue