public XbmcJsonRpcConnection(Uri uri, string username, string password)
        {
            this.client = new JsonRpcClient(uri, username, password);
            this.client.Log += onLog;
            this.client.LogError += onLogError;

            this.jsonRpc = new XbmcJsonRpc(this.client);
            this.player = new XbmcPlayer(this.client);
            this.system = new XbmcSystem(this.client);
            this.xbmc = new XbmcGeneral(this.client);
            this.files = new XbmcFiles(this.client);
            this.playlist = new XbmcPlaylist(this.client);
            this.library = new XbmcLibrary(this.client);
        }
Exemple #2
0
        public XbmcJsonRpcConnection(Uri uri, string username, string password)
        {
            this.client           = new JsonRpcClient(uri, username, password);
            this.client.Log      += onLog;
            this.client.LogError += onLogError;

            this.jsonRpc  = new XbmcJsonRpc(this.client);
            this.player   = new XbmcPlayer(this.client);
            this.system   = new XbmcSystem(this.client);
            this.xbmc     = new XbmcGeneral(this.client);
            this.files    = new XbmcFiles(this.client);
            this.playlist = new XbmcPlaylist(this.client);
            this.library  = new XbmcLibrary(this.client);
        }
        public override XbmcPlaylist <XbmcVideo> GetItems(int start, int end, params string[] fields)
        {
            this.client.LogMessage("XbmcVideoPlaylist.GetItems()");

            JObject query = this.getItems(fields, XbmcVideo.Fields, start, end);

            if (query == null || query["items"] == null)
            {
                this.client.LogErrorMessage("Playlist.GetItems(): Invalid response");

                return(null);
            }

            XbmcPlaylist <XbmcVideo> playlist = XbmcPlaylist <XbmcVideo> .FromJson(query, this.client);

            foreach (JObject item in (JArray)query["items"])
            {
                playlist.Add(XbmcVideo.FromJson(item, this.client));
            }

            return(playlist);
        }