(request: WSGIRequest)
return HttpResponse()
Removes a song identified by the given key from the queue.
Removes a song identified by the given key from the queue.
Removes a song identified by the given key from the queue .
def remove(request: WSGIRequest) -> HttpResponse:
    """Removes a song identified by the given key from the queue."""
    key = request.POST.get("key")
    if key is None:
        return HttpResponseBadRequest()
    ikey = int(key)
    try:
        removed = playback.queue.remove(ikey)
        # if we removed a song and it was added by autoplay,
        # we want it to be the new basis for autoplay
        if not removed.manually_requested:
            playback.handle_autoplay(removed.external_url or removed.title)
        else:
            playback.handle_autoplay()
    except models.QueuedSong.DoesNotExist:
        return HttpResponseBadRequest("song does not exist")
    return HttpResponse()
def remove ( request : WSGIRequest ) -> HttpResponse : key = request . POST . get ( "key" ) if key is None : return HttpResponseBadRequest ( ) ikey = int ( key ) try : removed = playback . queue . remove ( ikey ) # if we removed a song and it was added by autoplay, # we want it to be the new basis for autoplay if not removed . manually_requested : playback . handle_autoplay ( removed . external_url or removed . title ) else : playback . handle_autoplay ( ) except models . QueuedSong . DoesNotExist : return HttpResponseBadRequest ( "song does not exist" ) return HttpResponse ( )