def _setCustomStreamUrl(self, channel, stream_url):
if stream_url is not None:
image = ""
if ADDON.getSetting("addon.logos") == "true":
file_name = 'special://profile/addon_data/script.tvguide.fullscreen/icons.ini'
f = xbmcvfs.File(file_name)
items = f.read().splitlines()
f.close()
for item in items:
if item.startswith('['):
pass
elif item.startswith('#'):
pass
else:
url_icon = item.rsplit('|',1)
if len(url_icon) == 2:
url = url_icon[0]
icon = url_icon[1]
if url == stream_url:
if icon and icon != "nothing":
image = icon.rstrip('/')
c = self.conn.cursor()
if image:
c.execute('UPDATE OR REPLACE channels SET logo=? WHERE id=?' , (image, channel.id))
c.execute("DELETE FROM custom_stream_url WHERE channel=?", [channel.id])
c.execute("INSERT INTO custom_stream_url(channel, stream_url) VALUES(?, ?)",
[channel.id, stream_url.decode('utf-8', 'ignore')])
self.conn.commit()
c.close()
评论列表
文章目录