(self)
return song_id, song
Removes the first completed song from the queue and returns its id and the object.
Removes the first completed song from the queue and returns its id and the object.
Removes the first completed song from the queue and returns its id and the object .
def dequeue(self) -> Tuple[int, Optional["QueuedSong"]]:
        """Removes the first completed song from the queue and returns its id and the object."""
        song = self.confirmed().first()
        if song is None:
            return -1, None
        song_id = song.id
        song.delete()
        self.filter(index__gt=song.index).update(index=F("index") - 1)
        return song_id, song
def dequeue ( self ) -> Tuple [ int , Optional [ "QueuedSong" ] ] : song = self . confirmed ( ) . first ( ) if song is None : return - 1 , None song_id = song . id song . delete ( ) self . filter ( index__gt = song . index ) . update ( index = F ( "index" ) - 1 ) return song_id , song