(_request: WSGIRequest)
Resumes the current song if it is paused.
    No-op if already playing.
Resumes the current song if it is paused.
    No-op if already playing.
Resumes the current song if it is paused . No - op if already playing .
def play(_request: WSGIRequest) -> None:
    """Resumes the current song if it is paused.
    No-op if already playing."""
    with playback.mopidy_command() as allowed:
        if allowed:
            player.playback.play()
    try:
        # move the creation timestamp into the future for the duration of the pause
        # this ensures that the progress calculation (starting from created) is correct
        current_song = models.CurrentSong.objects.get()
        now = timezone.now()
        pause_duration = (now - current_song.last_paused).total_seconds()
        current_song.created += datetime.timedelta(seconds=pause_duration)
        current_song.created = min(current_song.created, now)
        current_song.save()
    except models.CurrentSong.DoesNotExist:
        pass
    storage.set("paused", False)
def play ( _request : WSGIRequest ) -> None : with playback . mopidy_command ( ) as allowed : if allowed : player . playback . play ( ) try : # move the creation timestamp into the future for the duration of the pause # this ensures that the progress calculation (starting from created) is correct current_song = models . CurrentSong . objects . get ( ) now = timezone . now ( ) pause_duration = ( now - current_song . last_paused ) . total_seconds ( ) current_song . created += datetime . timedelta ( seconds = pause_duration ) current_song . created = min ( current_song . created , now ) current_song . save ( ) except models . CurrentSong . DoesNotExist : pass storage . set ( "paused" , False )