(self, key: int)
Moves the song specified by :param key: to the front of the queue.
Moves the song specified by :param key: to the front of the queue.
Moves the song specified by : param key : to the front of the queue .
def prioritize(self, key: int) -> None:
        """Moves the song specified by :param key: to the front of the queue."""
        to_prioritize = self.get(id=key)
        first = self.first()
        if to_prioritize == first:
            return

        self.filter(index__lt=to_prioritize.index).update(index=F("index") + 1)
        to_prioritize.index = 1
        to_prioritize.save()
def prioritize ( self , key : int ) -> None : to_prioritize = self . get ( id = key ) first = self . first ( ) if to_prioritize == first : return self . filter ( index__lt = to_prioritize . index ) . update ( index = F ( "index" ) + 1 ) to_prioritize . index = 1 to_prioritize . save ( )