(request: WSGIRequest)
return HttpResponse()
Reorders the queue.
    The song specified by element is inserted between prev and next.
Reorders the queue.
    The song specified by element is inserted between prev and next.
Reorders the queue . The song specified by element is inserted between prev and next .
def reorder(request: WSGIRequest) -> HttpResponse:
    """Reorders the queue.
    The song specified by element is inserted between prev and next."""
    prev_key = request.POST.get("prev")
    cur_key = request.POST.get("element")
    next_key = request.POST.get("next")
    if not cur_key:
        return HttpResponseBadRequest()
    if not prev_key:
        iprev_key = None
    else:
        iprev_key = int(prev_key)
    icur_key = int(cur_key)
    if not next_key:
        inext_key = None
    else:
        inext_key = int(next_key)
    try:
        playback.queue.reorder(iprev_key, icur_key, inext_key)
    except ValueError:
        return HttpResponseBadRequest("request on old state")
    return HttpResponse()
def reorder ( request : WSGIRequest ) -> HttpResponse : prev_key = request . POST . get ( "prev" ) cur_key = request . POST . get ( "element" ) next_key = request . POST . get ( "next" ) if not cur_key : return HttpResponseBadRequest ( ) if not prev_key : iprev_key = None else : iprev_key = int ( prev_key ) icur_key = int ( cur_key ) if not next_key : inext_key = None else : inext_key = int ( next_key ) try : playback . queue . reorder ( iprev_key , icur_key , inext_key ) except ValueError : return HttpResponseBadRequest ( "request on old state" ) return HttpResponse ( )