Ejemplo n.º 1
0
        /// <summary>
        /// Attach Get Episode Commands
        /// </summary>
        /// <param name="client">Spotify Sdk Client</param>
        /// <param name="response">Episode Response</param>
        /// <param name="overrideIsAttach">Override Is Attach?</param>
        public static void AttachGetEpisodeCommands(
            this ISpotifySdkClient client,
            EpisodeResponse response,
            bool?overrideIsAttach = null)
        {
            var isAttach = GetConfig(client.Config.IsAttachGetEpisodeCommands, overrideIsAttach);

            if (response != null)
            {
                // Episode Command
                if (client.CommandActions.Episode != null)
                {
                    response.Command = new GenericCommand <EpisodeResponse>(
                        client.CommandActions.Episode);
                }
                // Add User Playback Command
                response.AddUserPlaybackCommand = new GenericCommand <IPlaybackResponse>(
                    client.AddUserPlaybackHandler);
                // Add User Playback Queue Command
                response.AddUserPlaybackQueueCommand = new GenericCommand <IPlayItemResponse>(
                    client.AddUserPlaybackQueueHandler);
                // Add Playlist Item Command
                if (client.CommandActions.AddPlaylistItem != null)
                {
                    response.AddPlaylistItemCommand = new GenericCommand <IPlayItemResponse>(
                        client.CommandActions.AddPlaylistItem);
                }
                // Show Command
                if (response?.Show != null)
                {
                    client.AttachGetShowCommands(response.Show, isAttach);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Attach List Shows Commands
 /// </summary>
 /// <param name="client">Spotify Sdk Client</param>
 /// <param name="responses">Show Responses</param>
 public static void AttachListShowsCommands(
     this ISpotifySdkClient client,
     NavigationResponse <ShowResponse> responses)
 {
     if (client.Config.IsAttachListShowsCommands && responses?.Items != null)
     {
         responses.Items.ForEach(item => client.AttachGetShowCommands(item, client.Config.IsAttachListShowsCommands));
     }
 }