@page "{user}" @using RTMPDash.DataModels @model ProfileModel @{ ViewData["Title"] = "View"; var db = new AppDb.DbConn(); if (!db.Users.Any(p => p.Username == Model.User)) { Response.Redirect("/"); return; } var user = db.Users.First(p => p.Username == Model.User); var live = StreamUtils.IsLive(user.Username); Stream stream = null; if (live) { stream = StreamUtils.GetStatsObject().Server.Applications.First(p => p.Name == "ingress").MethodLive.Streams.First(p => p.Name == user.Username); } var pronounAdditional = user.PronounSubject == "they" ? "are" : "is"; // TODO make this configurable too }

Welcome to @Model.User's page!

@if (live) { var videoInfo = $"{stream.Meta.Video.Height}p{Math.Round(double.Parse(stream.Meta.Video.FrameRate))} @ {Math.Round(double.Parse(stream.BwIn) / 1000000, 2)} Mbps"; @if (!string.IsNullOrWhiteSpace(user.ChatUrl)) {

@user.PronounSubject.FirstCharToUpper() @pronounAdditional currently live! @user.PronounPossessive.FirstCharToUpper() stream chat is located here.

} else {

@user.PronounSubject.FirstCharToUpper() @pronounAdditional currently live! @user.PronounSubject.FirstCharToUpper() have not specified a stream chat URL, so enjoy @user.PronounPossessive content!

}
Source - @(stream.Meta.Video.Height)p @if (user.AllowRestream) { if ((user.RestreamUrls ?? "").Contains(",")) { Source - @(stream.Meta.Video.Height)p">Twitch Restream YouTube Restream } else if (!string.IsNullOrWhiteSpace(user.RestreamUrls)) { Twitch Restream } }
} else { if (!string.IsNullOrWhiteSpace(user.AnnouncementUrl)) {

@user.PronounSubject.FirstCharToUpper() @pronounAdditional not currently live. @user.PronounSubject.FirstCharToUpper() have indicated that @user.PronounSubject will announce their streams here.

} else {

@user.PronounSubject.FirstCharToUpper() @pronounAdditional not currently live. @user.PronounSubject.FirstCharToUpper() have not specified an announcement URL, so check back later!

} }