示例#1
0
def library_channel_remove_strm(channel, folder):
    enc_season = ("Season %s" % season).translate(None, '\/:*?"<>|').strip(".")
    enc_name = "S%02dE%02d" % (season, episode)

    channel_folder = os.path.join(folder, channel)
    stream_file = os.path.join(channel_folder, channel + ".strm")
    if xbmcvfs.exists(stream_file):
        xbmcvfs.delete(stream_file)
        xbmcvfs.rmdir(channel_folder)
        return True
    return False
示例#2
0
def library_channel_remove_strm(channel, folder):
    enc_season = ('Season %s' % season).translate(None, '\/:*?"<>|').strip('.')
    enc_name = 'S%02dE%02d' % (season, episode)
    
    channel_folder = os.path.join(folder, channel)
    stream_file = os.path.join(channel_folder, channel + '.strm')
    if xbmcvfs.exists(stream_file):
        xbmcvfs.delete(stream_file)
        xbmcvfs.rmdir(channel_folder)
        return True
    return False
示例#3
0
文件: live.py 项目: KingPug75/repo
def library_channel_remove_strm(channel, folder):
    channel_folder = os.path.join(folder, channel)
    stream_file = os.path.join(channel_folder, channel + '.strm')
    info_file = os.path.join(channel_folder, 'player.info')
    nfo_file = os.path.join(channel_folder, channel + '.nfo')
    if xbmcvfs.exists(stream_file):
        xbmcvfs.delete(stream_file)
        xbmcvfs.delete(info_file)
        xbmcvfs.delete(nfo_file)
        xbmcvfs.rmdir(channel_folder)
        return True
    return False
示例#4
0
def library_tv_remove_strm(show, folder, id, season, episode):
    enc_season = ('Season %s' % season).translate(None, '\/:*?"<>|').strip('.')
    enc_name = 'S%02dE%02d' % (season, episode)
    season_folder = os.path.join(folder, enc_season)
    stream_file = os.path.join(season_folder, enc_name + "%s" % plugin.get_setting(SETTING_LIBRARY_TAGS, unicode) + '.strm')
    if xbmcvfs.exists(stream_file):
        xbmcvfs.delete(stream_file)
        while not xbmc.abortRequested and xbmcvfs.exists(stream_file):
            xbmc.sleep(1000)
        a,b = xbmcvfs.listdir(season_folder)
        if not a and not b:
            xbmcvfs.rmdir(season_folder)
        return True
    return False
示例#5
0
 def remove_folder(self, folder_id):
     if folder_id not in self.storage:
         return
     media_path = self.storage[folder_id][1]
     del self.storage[folder_id]
     if not direxists(media_path):
         return
     self.log.info("Removing from library folder: %s", media_path)
     files = xbmcvfs.listdir(media_path)[1]
     count_deleted = 0
     for f in files:
         if f.endswith("[%d].strm" % folder_id):
             path = os.path.join(media_path, f)
             self.log.info("Removing file: %s", path)
             xbmcvfs.delete(path)
             count_deleted += 1
     if len(files) == count_deleted:
         self.log.info("All files deleted, removing folder: %s", media_path)
         xbmcvfs.rmdir(media_path)