예제 #1
0
        public List <Track> LoadTracks()
        {
            Tracks = new List <Track>();

            try
            {
                string response = CurrentRuntime.ExecuteHttpGet($"/album/{Id}/tracks");
                if (string.IsNullOrEmpty(response) == false)
                {
                    var jsonResult = JsonConvert.DeserializeObject <Dictionary <string, object> >(response);

                    Tracks = JsonConvert.DeserializeObject <List <Track> >(jsonResult["data"].ToString());

                    foreach (Track track in Tracks)
                    {
                        track.CurrentRuntime = CurrentRuntime;
                        track.Album          = this;
                    }
                }
            }
            catch
            {
            }

            TracksCount = Tracks.Count;
            return(Tracks);
        }
예제 #2
0
        public async Task <List <Album> > LoadAlbums()
        {
            string responseContent = await CurrentRuntime.ExecuteHttpGet(string.Format("/artist/{0}/albums", Id));

            var jsonResult = JsonConvert.DeserializeObject <Dictionary <string, object> >(responseContent);

            Albums = JsonConvert.DeserializeObject <List <Album> >(jsonResult["data"].ToString());

            foreach (Album album in Albums)
            {
                album.CurrentRuntime = CurrentRuntime;
            }

            AlbumsCount = Albums.Count;

            return(Albums);
        }
예제 #3
0
        public List <Album> LoadAlbums()
        {
            Albums = new List <Album>();

            string response = CurrentRuntime.ExecuteHttpGet($"/artist/{Id}/albums");

            if (string.IsNullOrEmpty(response) == false)
            {
                var jsonResult = JsonConvert.DeserializeObject <Dictionary <string, object> >(response);

                Albums = JsonConvert.DeserializeObject <List <Album> >(jsonResult["data"].ToString());

                foreach (Album album in Albums)
                {
                    album.CurrentRuntime = CurrentRuntime;
                    album.Artist         = this;
                }

                AlbumsCount = Albums.Count;
            }

            return(Albums);
        }
예제 #4
0
        public void LoadTracks()
        {
            string responseContent = CurrentRuntime.ExecuteHttpGet($"/playlist/{Id}/tracks?limit=1000");

            InternalTracks = JsonConvert.DeserializeObject <TracksContainer>(responseContent);
        }
예제 #5
0
        public async Task LoadTracksAsync()
        {
            string responseContent = await CurrentRuntime.ExecuteHttpGet(string.Format("/playlist/{0}/tracks?limit=1000", Id));

            InternalTracks = JsonConvert.DeserializeObject <TracksContainer>(responseContent);
        }