Beispiel #1
0
        private async Task PushPlaylist(Playlist playlist, AudioPlayerState state)
        {
            JObject content = MobileHelper.SerializePlaylist(playlist, state,
                                                             await this.library.CurrentPlaybackTime.FirstAsync(),
                                                             await this.library.TotalTime.FirstAsync());

            NetworkMessage message = CreatePushMessage(PushAction.UpdateCurrentPlaylist, content);

            await this.SendMessage(message);
        }
Beispiel #2
0
        private async Task <ResponseInfo> GetCurrentPlaylist(JToken dontCare)
        {
            Playlist         playlist      = this.library.CurrentPlaylist;
            AudioPlayerState playbackState = await this.library.PlaybackState.FirstAsync();

            TimeSpan currentTime = await this.library.CurrentPlaybackTime.FirstAsync();

            TimeSpan totalTime = await this.library.TotalTime.FirstAsync();

            JObject content = MobileHelper.SerializePlaylist(playlist, playbackState, currentTime, totalTime);

            return(CreateResponse(ResponseStatus.Success, null, content));
        }