private List <IMusicList> GetMydiss(IEnumerable <JToken> enumerable) { List <IMusicList> musics = new List <IMusicList>(); foreach (var tk in enumerable) { String subtitle = Convert.ToString(tk.SelectToken("subtitle")); String disstid = Convert.ToString(tk.SelectToken("dissid")); var tempmusiclist = new MusicList_QQ { authorname = this.userinfo.name, avatarUrl = Convert.ToString(tk.SelectToken("picurl")), disstid = disstid, name = Convert.ToString(tk.SelectToken("title")), subtitle = subtitle, dirid = Convert.ToString(tk.SelectToken("dirid")), songcount = ExtractMethod.GetResult(ExtractType.Regex, subtitle, "(\\d+)首", new RegexPam { Group = 1 }), playtimes = ExtractMethod.GetResult(ExtractType.Regex, subtitle, "(\\d+)次播放", new RegexPam { Group = 1 }), musicListType = MusicListType.Owner }; tempmusiclist.musics = GetMusic(disstid, Convert.ToInt32(tempmusiclist.songcount)); musics.Add(tempmusiclist); } return(musics); }
//我喜欢部分 private IEnumerable <IMusicList> GetMymusic(IEnumerable <JToken> enumerable) { List <IMusicList> musics = new List <IMusicList>(); foreach (var tk in enumerable) { String subtitle = Convert.ToString(tk.SelectToken("subtitle")); String disstid = Convert.ToString(tk.SelectToken("id")); var tempmusiclist = new MusicList_QQ { authorname = this.userinfo.name, avatarUrl = Convert.ToString(tk.SelectToken("picurl")), disstid = disstid, name = Convert.ToString(tk.SelectToken("title")), subtitle = subtitle, songcount = ExtractMethod.GetResult(ExtractType.Regex, subtitle, "(\\d+)首", new RegexPam { Group = 1 }), }; if (tempmusiclist.disstid.Equals("0")) { continue; } tempmusiclist.musics = GetMusic(disstid, Convert.ToInt32(tempmusiclist.songcount)); musics.Add(tempmusiclist); } return(musics); }