@page
@model InfoModel
@{
ViewData["Title"] = "Info";
}
@{
if (string.IsNullOrWhiteSpace(Request.Query["guid"]) || c3stream.GetEventByGuid(Request.Query["guid"]) == null) {
Response.Redirect("/");
return;
}
c3stream.UpdateCookie(Request, Response, $"/Info?guid={Request.Query["guid"]}&");
ConferenceModel.ReadUserData();
var talk = c3stream.GetEventByGuid(Request.Query["guid"]);
var state = ConferenceModel.UserData.FirstOrDefault(p => p.TalkId == Request.Query["guid"] && p.UserId == Request.Cookies["bookmark"])?.State;
if (talk == null) {
Response.Redirect("/");
return;
}
if (state == null) {
state = "unwatched";
}
var title = talk.Title;
var speakers = talk.Persons.Aggregate((s, s1) => $"{s}, {s1}");
var description = talk.Description;
if (string.IsNullOrEmpty(description)) {
description = "<missing description>";
}
var isWatched = state == "watched";
var isMarked = state == "marked";
var file = $"{talk.Slug}.mp4";
var conference = c3stream.GetConferenceByEventGuid(talk.Guid);
var tagV = c3stream.Conferences.First(c => c.Acronym == Request.Query["c"]).TagVersion;
var eventName = tagV == 0 ? conference.Acronym : talk.Tags[0].Replace("-", "-
@Html.Raw(description.Replace("\n", " ", "").Replace("
");
var category = talk.Tags.Count switch {
0 => "@title - @speakers
}
else if (isMarked) {
@title - @speakers
}
else {
@title - @speakers
}
").Replace("
https://@Request.Host.Value/Info?guid=@Request.Query["guid"]