def removeChannel(self,channelUsername):
'''
Remove channel with username channelUsername.
:return None
'''
# check if channel exists in channels
if channelUsername in self.cache.names:
# remove the channel from the cache
self.cache.deleteValue(channelUsername)
# if channel has playlists in cache
if channelUsername in self.playlistCache.names:
# delete the playlists for the channel
self.playlistCache.deleteValue(channelUsername)
# delte the channel timer
#del self.timer[channelUsername]
self.timer.deleteValue(channelUsername)
# delete the channel playlist timers
#for timer in self.timer.keys():
killArray=[]
for timer in self.timer.names:
if channelUsername+':' in timer:
killArray.append(timer)
#del self.timer[timer]
for item in killArray:
self.timer.deleteValue(item)
# save the changes to the data
xbmc.executebuiltin('container.Update('+_url+',replace)')
popup('YoutubeTV','Channel '+channelUsername+' removed')
评论列表
文章目录