log fixes

pull/1/head
DiMartinoXBMC 2015-08-27 17:17:19 +03:00
parent 8300a00adc
commit b018d83178
4 changed files with 14 additions and 13 deletions

16
Core.py
View File

@ -376,16 +376,16 @@ class Core:
progress=int(jsoninfo.get('progress'))
if status=='pause':
status_sign='[||]'
img=self.ROOT + '/icons/pause-icon.png'
img = os.path.join(self.ROOT, '/icons/', 'pause-icon.png')
elif status=='stopped':
status_sign='[X]'
img=self.ROOT + '/icons/stop-icon.png'
img = os.path.join(self.ROOT, '/icons/', 'stop-icon.png')
else:
status_sign='[>]'
if progress==100:
img=self.ROOT + '/icons/upload-icon.png'
img = os.path.join(self.ROOT, '/icons/', 'upload-icon.png')
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)
if jsoninfo.get('seeds')!=None and jsoninfo.get('peers')!=None and \
@ -1147,10 +1147,10 @@ class Core:
status = TextBB(' [||] ', 'b')
elif data['status'] in ('seeding', 'downloading'):
status = TextBB(' [>] ', 'b')
if data['status']=='seed_pending':img=self.ROOT + '/icons/pause-icon.png'
elif data['status']=='stopped': img=self.ROOT + '/icons/stop-icon.png'
elif data['status']=='seeding':img=self.ROOT + '/icons/upload-icon.png'
elif data['status']=='downloading':img=self.ROOT + '/icons/download-icon.png'
if data['status'] == 'seed_pending': os.path.join(self.ROOT, '/icons/', 'pause-icon.png')
elif data['status'] == 'stopped': os.path.join(self.ROOT, '/icons/', 'stop-icon.png')
elif data['status'] == 'seeding': os.path.join(self.ROOT, '/icons/', 'upload-icon.png')
elif data['status'] == 'downloading': os.path.join(self.ROOT, '/icons/', 'download-icon.png')
menu.append(
{"title": '[' + str(data['progress']) + '%]' + status + data['name'] + ' [' + str(
data['ratio']) + ']', "image":img,

View File

@ -313,7 +313,7 @@ def localize(text):
'Torrent Downloading': 'Завантаження торренту',
'Auth expired, please relogin': 'Авторизація сплила, будь ласка, увійдіть знову',
'Storage': 'Сховище',
'Storage was cleared': 'Сховище очищене',
'Storage has been cleared': 'Сховище очищене',
'Clear Storage': 'Очистити сховище',
'Popular': 'Популярне',
'Views': 'Перегляди',

View File

@ -355,6 +355,7 @@ class TorrentPlayer(xbmc.Player):
if response:
# xbmc.Player().play(path, listitem)
log('Megakostil worked! Start playing '+str(path))
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
playlist.add(path, listitem)

View File

@ -46,7 +46,7 @@ ROOT = __settings__.getAddonInfo('path') # .decode('utf-8').encode(sys.getfiles
userStorageDirectory = __settings__.getSetting("storage")
USERAGENT = "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0"
__addonpath__ = __settings__.getAddonInfo('path')
icon = __addonpath__ + '/icon.png'
icon = os.path.join(__addonpath__, '/icon.png')
__version__ = __settings__.getAddonInfo('version')
__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__
@ -73,11 +73,11 @@ def clearStorage(userStorageDirectory):
torrents_bool, saved_bool = False, False
if os.path.exists(torrents):
torrents_bool = shutil.move(torrents, torrents_temp)
shutil.move(torrents, torrents_temp)
torrents_bool = True
if os.path.exists(saved):
saved_bool = shutil.move(saved, saved_temp)
shutil.move(saved, saved_temp)
saved_bool = True
shutil.rmtree(userStorageDirectory, ignore_errors=True)
@ -88,7 +88,7 @@ def clearStorage(userStorageDirectory):
if saved_bool:
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:
showMessage(Localization.localize('Storage'), Localization.localize('Does not exists'), forced=True)