@page
@model InfoModel
@{
ViewData["Title"] = "Info";
}
@{
if (string.IsNullOrWhiteSpace(Request.Query["guid"])) {
Response.Redirect("/");
return;
}
c3stream.UpdateCookie(Request, Response, $"/Info?guid={Request.Query["guid"]}&");
ConferenceModel.ReadEventMetadata();
var talk = ConferenceModel.EventMetadata.FirstOrDefault(p => p.Guid == Request.Query["guid"]);
if (talk == null) {
Response.Redirect("/");
return;
}
var title = talk.Talk.Title;
var speakers = talk.Talk.Persons.Aggregate((s, s1) => $"{s}, {s1}");
var description = talk.Talk.Description;
if (string.IsNullOrEmpty(description)) {
description = "<missing description>";
}
var isWatched = talk.State.FirstOrDefault(q => q.Guid == Request.Cookies["bookmark"])?.State == "watched";
var isMarked = talk.State.FirstOrDefault(q => q.Guid == Request.Cookies["bookmark"])?.State == "marked";
var file = talk.Talk.Recordings.FirstOrDefault(p => System.IO.File.Exists(System.IO.Path.Combine(c3stream.CachePath, talk.Talk.ConferenceUrl.AbsoluteUri.Split("/").Last(), p.Filename)));
var eventName = talk.Talk.Tags[0].Replace("-", "-
");
int tagFormat;
switch (talk.Talk.ConferenceUrl.AbsoluteUri.Split("/").Last()) {
case "36c3":
tagFormat = 2;
break;
case "35c3":
case "34c3":
tagFormat = 1;
break;
case "33c3":
tagFormat = 0;
break;
default:
Response.Redirect("/");
return;
}
var category = tagFormat switch {
0 => talk.Talk.Tags[0],
1 => talk.Talk.Tags[2],
2 => talk.Talk.Tags[3],
_ => ""
};
}
@if (isWatched) {
@Html.Raw(description.Replace("\n", "
").Replace("
", "").Replace("
", "")) Share this talk:https://@Request.Host.Value/Info?guid=@Request.Query["guid"]