def getDownloaderStatus():
for filename in os.listdir(ADDON.getSetting("config.plugins.iptvplayer.NaszaSciezka")):
if filename.endswith('.wget'):
myLog('Found: [%s]' % filename)
list_item = xbmcgui.ListItem(label = filename[:-5])
url = get_url(action='wgetRead', fileName=filename)
is_folder = False
last_Lines = ''
with open(os.path.join(ADDON.getSetting("config.plugins.iptvplayer.NaszaSciezka") , filename)) as f:
last_Lines = f.readlines()[-5:]
f.close()
if ''.join(last_Lines).find('100%') > 0:
list_item.setArt({'thumb': xbmc.translatePath('special://home/addons/plugin.video.IPTVplayer/resources/icons/done.png')})
else:
list_item.setArt({'thumb': xbmc.translatePath('special://home/addons/plugin.video.IPTVplayer/resources/icons/progress.png')})
xbmcplugin.addDirectoryItem(ADDON_handle, url, list_item, is_folder)
#last but not least delete all status files
list_item = xbmcgui.ListItem(label = _(30434))
url = get_url(action='wgetDelete')
is_folder = False
list_item.setArt({'thumb': xbmc.translatePath('special://home/addons/plugin.video.IPTVplayer/resources/icons/delete.png')})
xbmcplugin.addDirectoryItem(ADDON_handle, url, list_item, is_folder)
#closing directory
xbmcplugin.endOfDirectory(ADDON_handle)
return
评论列表
文章目录