def deleteStation(id): if (id != 'undefined'): index = int(id) pos = index+1 mpc.sysCmd('mpc del ' + str(pos)) mpc.savePlaylist() return "true" return "false"
def saveStation(id): if (id != 'undefined'): stationUrl = request.forms.url # check if the station is defined index = int(id) stationList = getStationList() stationCount = len(stationList['stations']) if(len(stationUrl) > 5): if(index >= 0): pos = index+1; mpc.sysCmd('mpc del ' + str(pos)) mpc.sysCmd('mpc add ' + stationUrl) if(index >= 0): mpc.sysCmd('mpc move ' + str(stationCount) + ' ' + str(pos)) mpc.savePlaylist() return "true" return "false"
def moveStation(posFrom, posTo): mpc.telnetCmd('move ' + posFrom + ' ' + posTo) mpc.savePlaylist() return posTo