public ActionResult GetArtistInfo(string artist, bool ret = false) { ViewBag.artist = FunctionsMusic.GetArtistInfo(artist); ViewBag.toptracks = FunctionsMusic.GetTopTracks(artist); ViewBag.ret = ret; return(View()); }
public ActionResult GetRelated(string artist, string track, int index = 0) { artist = Url.Encode(artist.Trim()); track = Url.Encode(track.Trim()); var data = FunctionsMusic.GetSimilar(artist, track); index += 3; dynamic c = JObject.Parse(data); var obj = c.similartracks.track[index]; var output = new { track = obj.name, artist = obj.artist.name, source = "Related Track" }; var img = obj.image[3].text; if (output.track == "") { index -= 3; dynamic top = JObject.Parse(FunctionsMusic.GetTopTracks(artist)); img = top.tracks.toptracks[index].image[3].text; output = new { track = top.toptracks.track[index].name, artist = top.toptracks.track[index].artist.name, source = "Top Artist" }; if (top.toptracks.track[index].name != "") { artist = Url.Encode(output.artist); track = Url.Encode(output.track); top = JObject.Parse(FunctionsMusic.GetSimilar(artist, track)); output = new { track = top.similartracks.track[index].name, artist = top.similartracks.track[index].artist.name, source = "Related Track 2" }; } } if (img == "") { img = "/images/no-cover.png"; } var outputf = new { artist = output.artist, track = output.track, source = output.source, cover = img, key2 = SHA1.Create(output.track + output.artist) }; return(Json(outputf)); }
public ActionResult GetSongInfo(string artist, string track, bool ret = false, string extra = "") { ViewBag.song = FunctionsMusic.GetTrackInfo(artist, track); ViewBag.lyrics = FunctionsMusic.GetLyric(artist, track); if (extra != "") { ViewBag.artist = extra; } else { ViewBag.artist = FunctionsMusic.GetArtistInfo(artist); } ViewBag.toptracks = FunctionsMusic.GetTopTracks(artist); ViewBag.ret = ret; return(View()); }
public ActionResult GetTopTracks() { ViewBag.top = FunctionsMusic.GetTopTracks(); return(View()); }