2018-09-21, 20:25
Hello,
Just a minor contribution as I hate ERROR messages on logs...
Scenario, when booting if dont have temp directory it throw and error saying that cannot get the temp Directory so I modified /.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/utils/monitor.py because it had useless code....so, no more startup ERROR´s
def remove_temp_dir():
temp_path = 'special://temp/plugin.video.youtube/'
path = xbmc.translatePath(temp_path)
if xbmcvfs.exists(path):
try:
xbmcvfs.rmdir(path, force=True)
except:
try:
shutil.rmtree(path)
except:
xbmc.log('Failed to remove directory: {dir}'.format(dir=path), xbmc.LOGDEBUG)
return False
return True
Salud!!!
JakerMx
Just a minor contribution as I hate ERROR messages on logs...
Scenario, when booting if dont have temp directory it throw and error saying that cannot get the temp Directory so I modified /.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/utils/monitor.py because it had useless code....so, no more startup ERROR´s
def remove_temp_dir():
temp_path = 'special://temp/plugin.video.youtube/'
path = xbmc.translatePath(temp_path)
if xbmcvfs.exists(path):
try:
xbmcvfs.rmdir(path, force=True)
except:
try:
shutil.rmtree(path)
except:
xbmc.log('Failed to remove directory: {dir}'.format(dir=path), xbmc.LOGDEBUG)
return False
return True
Salud!!!
JakerMx