def copyFave(name, thumb, cmd): import os text = GETTEXT(30019) startFolder = '' if ADDON.getSetting('MENU_PREV_LOCN') == 'true': startFolder = xbmcgui.Window(10000).getProperty('SF_CAPTURE_FOLDER') if len(startFolder) == 0: startFolder = None folder = utils.GetFolder(text, startFolder) if not folder: return False xbmcgui.Window(10000).setProperty('SF_CAPTURE_FOLDER', folder) file = os.path.join(folder, utils.FILENAME) if ADDON.getSetting('MENU_EDITFAVE') == 'true': name = getText(GETTEXT(30021), name) if not name: return False fave = [name, thumb, cmd] return favourite.copyFave(file, fave)
def copyFave(name, thumb, cmd): import favourite text = GETTEXT(30019) folder = utils.GetFolder(text) if not folder: return False file = os.path.join(folder, utils.FILENAME) fave = [name, thumb, cmd] return favourite.copyFave(file, fave)
def copyFave(name, thumb, cmd): import favourite text = GETTEXT(30019) folder = utils.GetFolder(text) if not folder: return False file = os.path.join(folder, utils.FILENAME) if MENU_EDITFAVE: name = getText(GETTEXT(30021), name) if not name: return False fave = [name, thumb, cmd] return favourite.copyFave(file, fave)
def copyFave(name, thumb, cmd): import favourite import utils text = utils.GETTEXT(30019) folder = utils.GetFolder(text) if not folder: return False file = os.path.join(folder, utils.FILENAME) faves = favourite.getFavourites(file) #if it is already in there don't add again for fave in faves: if favourite.equals(fave[2], cmd): return False fave = [name, thumb, cmd] return favourite.copyFave(file, fave)
def getFolder(title): return utils.GetFolder(title)