def get_own_pictures(path):
_, files = xbmcvfs.listdir(xbmc.translatePath(path))
images_dict = {}
image_file = os.path.join(xbmc.translatePath(path), "images.json")
if xbmcvfs.exists(image_file):
with open(image_file, "r") as f:
try:
images_dict = json.loads(f.read())
except ValueError:
kodiutils.log(kodiutils.get_string(32010), xbmc.LOGERROR)
for _file in files:
if _file.endswith(('.png', '.jpg', '.jpeg')):
returned_dict = {
"url": os.path.join(xbmc.translatePath(path), _file),
"private": True
}
if images_dict:
for image in images_dict:
if "image" in image.keys() and image["image"] == _file:
if "line1" in image.keys():
returned_dict["line1"] = image["line1"]
if "line2" in image.keys():
returned_dict["line2"] = image["line2"]
yield returned_dict
评论列表
文章目录