public TrackCount ( long playlistId ) : System.Web.Mvc.JsonResult | ||
playlistId | long | |
return | System.Web.Mvc.JsonResult |
public JsonResult TrackCount(long playlistId)
{
var playlist = playlistManager.ReadPlaylist(playlistId);
var count = playlist.PlaylistTracks.Count(p => p.PlayedAt == null);
var HistoryCount = playlist.PlaylistTracks.Count(p => p.PlayedAt != null);
return Json(new { Count = count, HistoryCount = HistoryCount}, JsonRequestBehavior.AllowGet);
}
}