Example #1
0
        public override void Execute(IEvent @event)
        {
            var success = false;
            var token   = @event.DataToken();

            if (token != null && token.Type == JTokenType.String)
            {
                var url = token.Value <string>();
                success = _libraryApiAdapter.PlayPlaylist(url);
            }
            var message = new SocketMessage(Constants.PlaylistPlay, success);

            _hub.Publish(new PluginResponseAvailableEvent(message));
        }
Example #2
0
        public override void Execute(IEvent receivedEvent)
        {
            if (receivedEvent == null)
            {
                throw new ArgumentNullException(nameof(receivedEvent));
            }

            var success = false;
            var token   = receivedEvent.DataToken();

            if (token != null && token.Type == JTokenType.String)
            {
                var url = token.Value <string>();
                success = _libraryApiAdapter.PlayPlaylist(url);
            }

            var message = new SocketMessage(Constants.PlaylistPlay, success);

            _hub.Publish(new PluginResponseAvailableEvent(message));
        }