Add dynamic package support

And a few other fixes
This commit is contained in:
angelblue05 2018-09-06 23:56:05 -05:00
parent 77843c7f1d
commit a18fa90f13
7 changed files with 56 additions and 95 deletions

View file

@ -4,6 +4,7 @@ from exceptions import LibraryException
from utils import addon_id
from utils import window
from utils import settings
from utils import kodi_version
from utils import dialog
from utils import find
from utils import event

View file

@ -408,7 +408,7 @@ class PlayUtils(object):
Since Emby returns all possible tracks together, sort them.
IsTextSubtitleStream if true, is available to download from server.
'''
if not source['MediaStreams']:
if not settings('enableExternalSubs.bool') or not source['MediaStreams']:
return
subs = []

View file

@ -226,12 +226,13 @@ def write_xml(content, file):
content = content.replace('?>', ' standalone="yes" ?>', 1)
infile.write(content)
def delete_build():
def delete_folder(path=None):
''' Delete objects from kodi cache
'''
LOG.debug("--[ delete objects ]")
path = xbmc.translatePath('special://temp/emby/').decode('utf-8')
LOG.debug("--[ delete folder ]")
path = path or xbmc.translatePath('special://temp/emby').decode('utf-8')
dirs, files = xbmcvfs.listdir(path)
delete_recursive(path, dirs)
@ -239,6 +240,9 @@ def delete_build():
for file in files:
xbmcvfs.delete(os.path.join(path, file.decode('utf-8')))
xbmcvfs.delete(path)
LOG.info("deleted %s", path)
def delete_recursive(path, dirs):
''' Delete files and dirs recursively.