Beispiel #1
0
        /// <summary>
        /// 获取专辑兆赫播放列表
        /// </summary>
        /// <param name="albumName">专辑名</param>
        public void GetAlbumFMNewPlayList(string albumName)
        {
            SearchedSongResult result = GetNewPlayList(2, string.Empty, albumName, string.Empty);

            if (result == null || result.SearchStatus == false)
            {
                isPlayListLoadFailed = true;
            }
            else if (result.SearchResult.SongsCount == 0)
            {
                isPlayListEmpty = true;
            }
            else
            {
                playList.Clear();
                foreach (SearchedSongEntity searchedSong in result.SearchResult.Songs)
                {
                    if (searchedSong.IsDeleted == false)
                    {
                        SongEntity song = MoreInfoAPI.GetSongEntity(searchedSong);
                        if (song != null)
                        {
                            playList.Enqueue(song);
                        }
                    }
                }
                EmptyCheck();
            }
        }
Beispiel #2
0
        /// <summary>
        /// 获取新播放列表(仅歌手兆赫和专辑兆赫)
        /// </summary>
        /// <param name="type">兆赫类型:1-歌手兆赫 2-专辑兆赫 其他-搜索兆赫</param>
        /// <param name="singerName">歌手名</param>
        /// <param name="albumName">专辑名</param>
        /// <param name="keyword">关键字</param>
        /// <returns>SearchedSongResult对象</returns>
        private SearchedSongResult GetNewPlayList(int type, string singerName, string albumName, string keyword)
        {
            string getData = string.Empty;

            if (type == 1)
            {
                getData = WebConnection.GetCommand(string.Format(@"http://douban.fm/j/open_channel/creation/search?keyword={0}&cate=singer&limit={1}", singerName, loadCount));
            }
            else if (type == 2)
            {
                getData = WebConnection.GetCommand(string.Format(@"http://douban.fm/j/open_channel/creation/search?keyword={0}&cate=album&limit={1}", albumName, loadCount));
            }
            else
            {
                getData = WebConnection.GetCommand(string.Format(@"http://douban.fm/j/open_channel/creation/search?keyword={0}&cate=misc&limit={1}", keyword, loadCount));
            }
            if (string.IsNullOrEmpty(getData))
            {
                isPlayListLoadFailed = true;
                return(null);
            }
            return(SearchedSongResult.Json2Object(getData));
        }