Ejemplo n.º 1
0
        public ICollection <XbmcArtist> GetArtists(int start, int end)
        {
            this.client.LogMessage("XbmcAudioLibrary.GetArtists()");

            JObject args = new JObject();

            args.Add(new JProperty("fields", XbmcArtist.Fields));
            if (start >= 0)
            {
                args.Add(new JProperty("start", start));
            }
            if (end >= 0)
            {
                args.Add(new JProperty("end", end));
            }

            JObject query = this.client.Call("AudioLibrary.GetArtists", args) as JObject;

            if (query == null || query["artists"] == null)
            {
                this.client.LogErrorMessage("AudioLibrary.GetArtists(): Invalid response");

                return(null);
            }

            List <XbmcArtist> artists = new List <XbmcArtist>();

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

            return(artists);
        }
        public ICollection<XbmcAlbum> GetAlbums(XbmcArtist artist, int start, int end, params string[] fields)
        {
            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }

            return this.getAlbums(artist.Id, -1, start, end, fields);
        }
Ejemplo n.º 3
0
        private ICollection <XbmcMusicVideo> GetMusicVideos(XbmcArtist artist, int start, int end, params string[] fields)
        {
            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }

            return(this.GetMusicVideos(artist.Id, -1, start, end, fields));
        }
Ejemplo n.º 4
0
        public ICollection <XbmcAlbum> GetAlbums(XbmcArtist artist, int start, int end, params string[] fields)
        {
            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }

            return(this.getAlbums(artist.Id, -1, start, end, fields));
        }
Ejemplo n.º 5
0
        public ICollection <XbmcSong> GetSongs(XbmcArtist artist, params string[] fields)
        {
            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }

            return(this.getSongs(-1, artist.Id, -1, -1, -1, fields));
        }
Ejemplo n.º 6
0
        private ICollection <XbmcMusicVideo> GetMusicVideos(XbmcArtist artist, XbmcAlbum album, params string[] fields)
        {
            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }
            if (album == null)
            {
                throw new ArgumentNullException("album");
            }

            return(this.GetMusicVideos(artist.Id, album.Id, -1, -1, fields));
        }
Ejemplo n.º 7
0
        public bool Play(XbmcArtist artist)
        {
            this.client.LogMessage("XbmcGeneral.Play(artist)");

            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }
            if (artist.Id < 0)
            {
                throw new ArgumentException("Invalid artist ID");
            }

            JObject args = new JObject();

            args.Add(new JProperty("artistid", artist.Id));

            return(this.client.Call("XBMC.Play", args) != null);
        }
Ejemplo n.º 8
0
        public bool Play(XbmcArtist artist)
        {
            this.client.LogMessage("XbmcGeneral.Play(artist)");

            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }
            if (artist.Id < 0)
            {
                throw new ArgumentException("Invalid artist ID");
            }

            JObject args = new JObject();
            args.Add(new JProperty("artistid", artist.Id));

            return (this.client.Call("XBMC.Play", args) != null);
        }
        public ICollection<XbmcSong> GetSongs(XbmcArtist artist, params string[] fields)
        {
            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }

            return this.getSongs(-1, artist.Id, -1, -1, -1, fields);
        }
Ejemplo n.º 10
0
        private ICollection<XbmcMusicVideo> GetMusicVideos(XbmcArtist artist, int start, int end, params string[] fields)
        {
            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }

            return this.GetMusicVideos(artist.Id, -1, start, end, fields);
        }
Ejemplo n.º 11
0
        private ICollection<XbmcMusicVideo> GetMusicVideos(XbmcArtist artist, XbmcAlbum album, params string[] fields)
        {
            if (artist == null)
            {
                throw new ArgumentNullException("artist");
            }
            if (album == null)
            {
                throw new ArgumentNullException("album");
            }

            return this.GetMusicVideos(artist.Id, album.Id, -1, -1, fields);
        }