@page "{user}" @using RTMPDash.DataModels @model ProfileModel @{ ViewData["Title"] = Model.User; 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 stats = StreamUtils.GetStatsObject(); var live = StreamUtils.IsLive(user.Username, stats) && !user.IsPrivate; Stream stream = null; if (live) { stream = stats.Server.Applications.First(p => p.Name == "ingress").MethodLive.Streams.FirstOrDefault(p => p.Name == user.Username); } var pronounAdditional = user.PronounPlural ? "are" : "is"; }

Welcome to @Model.User's page!

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

@user.PronounSubject.FirstCharToUpper() @pronounAdditional currently live!

} else {

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

}
@if (!string.IsNullOrWhiteSpace(user.ChatUrl)) { Chat } Source - @(stream?.Meta.Video.Height ?? "?")p @if (user.AllowRestream) { if ((user.RestreamUrls ?? "").Contains(",")) { 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. Click below to get notified when @user.PronounSubject @pronounAdditional live.

Announcements } else {

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

} }