Пример #1
0
def getMediaListDialog():
    thelist = fileSys.readMediaList(purge=False)
    items = []
    for entry in thelist:
        splits = entry.strip().split('|')
        plugin = re.search('%s([^\/\?]*)' % ("plugin:\/\/"), splits[2])
        items.append(stringUtils.getStrmname(splits[1]) + " (" + fileSys.getAddonname(plugin.group(1)) + ")")

    selectedItemsIndex = xbmcgui.Dialog().multiselect("Select items", items)
    return [thelist[index] for index in selectedItemsIndex] if selectedItemsIndex is not None else []
Пример #2
0
def removeItemsFromMediaList(action="list"):
    utils.addon_log("removingitemsdialog")
    thelist = fileSys.readMediaList(purge=False)
    items = [((thelist[i]).strip().split("|")[1]).format(i) for i in range(len(thelist))]
    dialog = dialoge.MultiChoiceDialog("Select items", items)
    dialog.doModal()

    fileSys.removeMediaList(dialog.selected, dictReplacements)

    xbmcgui.Dialog().notification("Finished deleting:", "{0}".format(str(dialog.selectedLabels)))
    del dialog
Пример #3
0
def removeItemsFromMediaList(action='list'):
    utils.addon_log('removingitemsdialog')
    thelist = fileSys.readMediaList(purge=False)
    items = [((thelist[i]).strip().split('|')[1]).format(i)
             for i in range(len(thelist))]
    dialog = dialoge.MultiChoiceDialog("Select items", items)
    dialog.doModal()

    fileSys.removeMediaList(dialog.selected, dictReplacements)

    xbmcgui.Dialog().notification("Finished deleting:",
                                  "{0}".format(str(dialog.selectedLabels)))
    del dialog
Пример #4
0
def getMediaListDialog():
    thelist = sorted(fileSys.readMediaList(purge=False),
                     key=lambda k: k.split('|')[1])
    items = []
    for entry in thelist:
        splits = entry.strip().split('|')
        matches = re.findall("plugin:\/\/([^\/\?]*)", splits[2])
        if matches:
            pluginnames = [fileSys.getAddonname(plugin) for plugin in matches]
            items.append(
                stringUtils.getStrmname(splits[1]) + " (%s)" %
                (', '.join(pluginnames)))

    selectedItemsIndex = xbmcgui.Dialog().multiselect("Select items", items)
    return [thelist[index]
            for index in selectedItemsIndex] if selectedItemsIndex else None
Пример #5
0
            if pagesDone < int(PAGINGalbums) and len(dirList) > 0:
                contentList = [item for sublist in dirList for item in sublist]
                dirList = []            

            if False:     
                try:
                    urlUtils.downloadThumb(aThumb, album, os.path.join(STRM_LOC, strm_type, artist)) 
                except:
                    pass             
        else:
            albumList.append([os.path.join(strm_type, stringUtils.getStrmname(strm_name) , label), stringUtils.cleanByDictReplacements(label), link])
            pagesDone = int(PAGINGalbums)

    try:
        # Write strms for all values in albumList
        thelist = fileSys.readMediaList(purge=False)
        items = []
        for entry in thelist:
            splits = entry.strip().split('|')
            splitsstrm = splits[0]
            splitsname = splits[1]
            if splitsstrm.find('Album') != -1 and splitsname.find(strm_name) != -1:
                url = splits[2]
                cType = splits[0]
                albumartist = artist
                fileSys.rewriteMediaList(url, strm_name, albumartist, cType)
        for i in albumList:
            fullpath, fileModTime = fileSys.writeSTRM(path, stringUtils.cleanStrms(i[1].rstrip(".")) , i[2] + "|" + i[1])
            kodiDB.musicDatabase(i[3], i[4], i[1], i[0], i[2], i[5], i[6], aThumb, fileModTime)
        thisDialog.dialogeBG.close()
    except IOError as (errno, strerror):