def get_custom_path(self, searchtitle, title):
'''locate custom folder on disk as pvrart location'''
title_path = ""
custom_path = self._mutils.addon.getSetting("pvr_art_custom_path")
if custom_path and self._mutils.addon.getSetting("pvr_art_custom") == "true":
delim = "\\" if "\\" in custom_path else "/"
dirs = xbmcvfs.listdir(custom_path)[0]
for strictness in [1, 0.95, 0.9, 0.8]:
if title_path:
break
for directory in dirs:
if title_path:
break
directory = directory.decode("utf-8")
curpath = os.path.join(custom_path, directory) + delim
for item in [title, searchtitle]:
match = SM(None, item, directory).ratio()
if match >= strictness:
title_path = curpath
break
if not title_path and self._mutils.addon.getSetting("pvr_art_download") == "true":
title_path = os.path.join(custom_path, normalize_string(title)) + delim
return title_path
pvrartwork.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录