Exemplo n.º 1
0
 public void Clear()
 {
     foreach (var song in _queue.QueuedSongs())
     {
         Delete(song);
     }
 }
Exemplo n.º 2
0
        private AudioSkillResponse HandlePlaybackNearlyFinishedRequest(AudioRequestBundle request)
        {
            _log.LogLine($"Handle PlaybackNearlyFinished request (token={request.Token}).");

            Guid.TryParse(request.Token, out Guid songRef);
            var songs   = _queueReader.QueuedSongs();
            var current = songs.FirstOrDefault(s => s.SongRef == songRef);

            if (current == null)
            {
                return(Failed($"Failed to find current song for token={songRef}"));
            }

            var index = songs.IndexOf(current);

            if (index + 1 < songs.Count)
            {
                var next = songs[index + 1];
                return(PlaySong(next, songs, false));
            }

            _log.LogLine("No songs left in queue.");
            return(DefaultResponse(request));
        }