Ejemplo n.º 1
0
def modifyBanList(request, player_id, lib_id, player):
  try:
    libEntry = LibraryEntry.objects.get(player=player, player_lib_song_id=lib_id)
    libEntry.is_banned=True if request.method == 'PUT' else False
    libEntry.save()
    if request.method == 'DELETE':
      removeIfOnPlaylist(libEntry)
    return HttpResponse()
  except ObjectDoesNotExist:
    toReturn = HttpResponseNotFound()
    toReturn[MISSING_RESOURCE_HEADER] = 'song'
    return toReturn
Ejemplo n.º 2
0
def deleteSongs(songIds, player):
  for song_id in songIds:
    libEntry = LibraryEntry.objects.get(player=player, player_lib_song_id=song_id)
    libEntry.is_deleted = True
    libEntry.save()
    removeIfOnPlaylist(libEntry)