Пример #1
0
        public Task AddSongToQueueAsync(AddSongToQueueRequest request)
        {
            if (request.IndexToInsertSongAt >= 0)
            {
                Queue.Insert(request.IndexToInsertSongAt, new QueuedTrack
                {
                    AlbumImageUrl = request.AlbumImageUrl,
                    Artist        = request.Artist,
                    Length        = request.Length,
                    Name          = request.Name,
                    Uri           = request.TrackUri,
                    AddedBy       = request.AddedBy,
                    Explicit      = request.Explicit
                });
            }
            else
            {
                Queue.Add(new QueuedTrack
                {
                    AlbumImageUrl = request.AlbumImageUrl,
                    Artist        = request.Artist,
                    Length        = request.Length,
                    Name          = request.Name,
                    Uri           = request.TrackUri,
                    AddedBy       = request.AddedBy,
                    Explicit      = request.Explicit
                });
            }

            return(Task.CompletedTask);
        }
Пример #2
0
        public async Task ModifyPlaylistAsync(AddSongToQueueRequest request)
        {
            await Playlist.AddSongToQueueAsync(request);

            // Play the song that was added to queue automatically
            if (Playlist.CurrentSong == null)
            {
                await Playlist.StartAsync();
            }
        }
Пример #3
0
        public Task AddSongToQueueAsync(AddSongToQueueRequest request)
        {
            Queue.Insert(request.IndexToInsertSongAt, new Song
            {
                AlbumImageUrl = request.AlbumImageUrl,
                Artist        = request.Artist,
                Length        = request.Length,
                Title         = request.Title,
                TrackUri      = request.TrackUri
            });

            return(Task.CompletedTask);
        }
Пример #4
0
 public async Task ModifyPlaylistAsync(AddSongToQueueRequest request)
 {
     await Playlist.AddSongToQueueAsync(request);
 }