public async Task <IActionResult> Skip(string voiceChannelId)
        {
            var session = await _playbackRepo.GetByDiscordIdAsync(voiceChannelId, new PlaybackSessionQueryOptions()
            {
                IncludeCurrentPlayback = true
            });

            var skipinfo = new SkipInfo
            {
                CurrentSongPlaybackId = session.CurrentSongPlayback.SpotifySongUri.Remove(0, 14),
                StartedUtc            = session.CurrentSongPlayback.StartedUtc
            };

            if (session == null)
            {
                return(new NotFoundResult());
            }

            var result = await _playbackSessionService.SkipAsync(session);

            if (result)
            {
                return(Ok(skipinfo));
            }
            else
            {
                return(StatusCode(500));
            }
        }
Пример #2
0
        void ISpEngineSite.GetSkipInfo(out int peType, out int plNumItems)
        {
            SkipInfo skipInfo = _site.GetSkipInfo();

            if (skipInfo != null)
            {
                peType     = skipInfo.Type;
                plNumItems = skipInfo.Count;
            }
            else
            {
                peType     = 1;
                plNumItems = 0;
            }
        }
Пример #3
0
        /// <summary>
        /// Retrieves the number and type of items to be skipped in the text stream.
        /// </summary>
        void ISpEngineSite.GetSkipInfo(out int peType, out int plNumItems)
        {
            SkipInfo si = _site.GetSkipInfo();

            if (si != null)
            {
                peType     = si.Type;
                plNumItems = si.Count;
            }
            else
            {
                peType     = 1; // BSPVSKIPTYPE.SPVST_SENTENCE;
                plNumItems = 0;
            }
        }