diff --git a/DataModels/Tables/States.cs b/DataModels/Tables/States.cs
index 048b41a..43f3c79 100644
--- a/DataModels/Tables/States.cs
+++ b/DataModels/Tables/States.cs
@@ -1,10 +1,10 @@
using LinqToDB.Mapping;
-namespace c3stream.DataModels.Tables {
- [Table(Name = "States")]
- public class States {
- [Column(Name = "TalkId"), PrimaryKey, NotNull] public string TalkId { get; set; }
- [Column(Name = "UserId"), PrimaryKey, NotNull] public string UserId { get; set; }
- [Column(Name = "State"), NotNull] public string State { get; set; }
- }
+namespace c3stream.DataModels.Tables;
+
+[Table(Name = "States")]
+public class States {
+ [Column(Name = "TalkId"), PrimaryKey, NotNull] public string TalkId { get; set; }
+ [Column(Name = "UserId"), PrimaryKey, NotNull] public string UserId { get; set; }
+ [Column(Name = "State"), NotNull] public string State { get; set; }
}
\ No newline at end of file
diff --git a/Migrations.cs b/Migrations.cs
index 794f2b5..c434e08 100644
--- a/Migrations.cs
+++ b/Migrations.cs
@@ -11,7 +11,7 @@ namespace c3stream;
public static class Migrations {
private const int DbVer = 0;
- private static readonly List _migrations = new() { };
+ private static readonly List _migrations = new();
public static void RunMigrations() {
using var db = new Database.DbConn();
diff --git a/Pages/Conference.cshtml b/Pages/Conference.cshtml
index 7cf2adb..5578d74 100644
--- a/Pages/Conference.cshtml
+++ b/Pages/Conference.cshtml
@@ -1,8 +1,6 @@
@page
-@model ConferenceModel
-@using System.Net
@using global::c3stream.DataModels
-@using static ConferenceModel
+@model ConferenceModel
@{
if (c3stream.Conferences.All(c => c.Acronym != Request.Query["c"])) {
Response.Redirect("/");
diff --git a/Pages/Conference.cshtml.cs b/Pages/Conference.cshtml.cs
index 7cb7be7..bd68fb9 100644
--- a/Pages/Conference.cshtml.cs
+++ b/Pages/Conference.cshtml.cs
@@ -1,39 +1,37 @@
-using System.Collections.Generic;
-using System.Linq;
+using System.Linq;
using c3stream.DataModels;
using c3stream.DataModels.Tables;
using LinqToDB;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
-namespace c3stream.Pages {
- public class ConferenceModel : PageModel {
- private readonly ILogger _logger;
+namespace c3stream.Pages;
- public ConferenceModel(ILogger logger) => _logger = logger;
+public class ConferenceModel : PageModel {
+ private readonly ILogger _logger;
- public void OnGet() {
- var guid = Request.Query["guid"].ToString();
- var state = Request.Query["state"].ToString();
- var userid = Request.Cookies["bookmark"];
- if (string.IsNullOrWhiteSpace(guid) || string.IsNullOrWhiteSpace(state) || !Request.Cookies.ContainsKey("bookmark"))
- return;
+ public ConferenceModel(ILogger logger) => _logger = logger;
- using var db = new Database.DbConn();
- var existing = db.States.FirstOrDefault(p => p.TalkId == guid && p.UserId == userid);
- if (existing != null)
- if (state == "unwatched")
- db.States.Delete(p => p == existing);
- else {
- existing.State = state;
- db.Update(existing);
- }
- else
- db.Insert(new States {
- State = state, TalkId = guid, UserId = userid
- });
- Response.Redirect("/");
- }
+ public void OnGet() {
+ var guid = Request.Query["guid"].ToString();
+ var state = Request.Query["state"].ToString();
+ var userid = Request.Cookies["bookmark"];
+ if (string.IsNullOrWhiteSpace(guid) || string.IsNullOrWhiteSpace(state) || !Request.Cookies.ContainsKey("bookmark"))
+ return;
+
+ using var db = new Database.DbConn();
+ var existing = db.States.FirstOrDefault(p => p.TalkId == guid && p.UserId == userid);
+ if (existing != null)
+ if (state == "unwatched") {
+ db.States.Delete(p => p == existing);
+ }
+ else {
+ existing.State = state;
+ db.Update(existing);
+ }
+ else
+ db.Insert(new States { State = state, TalkId = guid, UserId = userid });
+
+ Response.Redirect("/");
}
}
\ No newline at end of file
diff --git a/Pages/Error.cshtml b/Pages/Error.cshtml
index 89a1b7f..ef1bc8e 100644
--- a/Pages/Error.cshtml
+++ b/Pages/Error.cshtml
@@ -1,25 +1,25 @@
@page
@model ErrorModel
@{
- ViewData["Title"] = "Error";
+ ViewData["Title"] = "Error";
}
Error.
An error occurred while processing your request.
@if (Model.ShowRequestId) {
-
- Request ID:@Model.RequestId
-
+
+ Request ID:@Model.RequestId
+
}
Development Mode
- Swapping to the Development environment displays detailed information about the error that occurred.
+ Swapping to the Development environment displays detailed information about the error that occurred.
- The Development environment shouldn't be enabled for deployed applications.
- It can result in displaying sensitive information from exceptions to end users.
- For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
- and restarting the app.
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
\ No newline at end of file
diff --git a/Pages/Error.cshtml.cs b/Pages/Error.cshtml.cs
index 7e9b21b..330f216 100644
--- a/Pages/Error.cshtml.cs
+++ b/Pages/Error.cshtml.cs
@@ -3,19 +3,19 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
-namespace c3stream.Pages {
- [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
- public class ErrorModel : PageModel {
- private readonly ILogger _logger;
+namespace c3stream.Pages;
- public ErrorModel(ILogger logger) => _logger = logger;
+[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+public class ErrorModel : PageModel {
+ private readonly ILogger _logger;
- public string RequestId { get; set; }
+ public ErrorModel(ILogger logger) => _logger = logger;
- public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+ public string RequestId { get; set; }
- public void OnGet() {
- RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
- }
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+
+ public void OnGet() {
+ RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
\ No newline at end of file
diff --git a/Pages/Index.cshtml.cs b/Pages/Index.cshtml.cs
index b237605..70cec97 100644
--- a/Pages/Index.cshtml.cs
+++ b/Pages/Index.cshtml.cs
@@ -1,12 +1,12 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
-namespace c3stream.Pages {
- public class IndexModel : PageModel {
- private readonly ILogger _logger;
+namespace c3stream.Pages;
- public IndexModel(ILogger logger) => _logger = logger;
+public class IndexModel : PageModel {
+ private readonly ILogger _logger;
- public void OnGet() { }
- }
+ public IndexModel(ILogger logger) => _logger = logger;
+
+ public void OnGet() { }
}
\ No newline at end of file
diff --git a/Pages/Info.cshtml b/Pages/Info.cshtml
index 0a429f6..d4bb34a 100644
--- a/Pages/Info.cshtml
+++ b/Pages/Info.cshtml
@@ -2,115 +2,115 @@
@using global::c3stream.DataModels
@model InfoModel
@{
- ViewData["Title"] = "Info";
+ ViewData["Title"] = "Info";
}
@{
- if (string.IsNullOrWhiteSpace(Request.Query["guid"]) || c3stream.GetEventByGuid(Request.Query["guid"]) == null) {
- Response.Redirect("/");
- return;
- }
+ if (string.IsNullOrWhiteSpace(Request.Query["guid"]) || c3stream.GetEventByGuid(Request.Query["guid"]) == null) {
+ Response.Redirect("/");
+ return;
+ }
- var cookie = c3stream.UpdateCookie(Request, Response, $"/Info?guid={Request.Query["guid"]}");
-
- await using var db = new Database.DbConn();
+ var cookie = c3stream.UpdateCookie(Request, Response, $"/Info?guid={Request.Query["guid"]}");
- var talk = c3stream.GetEventByGuid(Request.Query["guid"]);
- var state = db.States.FirstOrDefault(p => p.TalkId == Request.Query["guid"].ToString() && p.UserId == cookie)?.State;
- if (talk == null) {
- Response.Redirect("/");
- return;
- }
- if (state == null) {
- state = "unwatched";
- }
+ await using var db = new Database.DbConn();
- var title = talk.Title;
- var speakers = talk.Persons.Any() ? talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") : "";
- var description = talk.Description;
- if (string.IsNullOrEmpty(description)) {
- description = "<missing description>";
- }
+ var talk = c3stream.GetEventByGuid(Request.Query["guid"]);
+ var state = db.States.FirstOrDefault(p => p.TalkId == Request.Query["guid"].ToString() && p.UserId == cookie)?.State;
+ if (talk == null) {
+ Response.Redirect("/");
+ return;
+ }
+ if (state == null) {
+ state = "unwatched";
+ }
- var isWatched = state == "watched";
- var isMarked = state == "marked";
- var file = $"{talk.Slug}.mp4";
- var conference = c3stream.GetConferenceByEventGuid(talk.Guid);
+ var title = talk.Title;
+ var speakers = talk.Persons.Any() ? talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") : "";
+ var description = talk.Description;
+ if (string.IsNullOrEmpty(description)) {
+ description = "<missing description>";
+ }
- var eventName = talk.Tags.Count <= 1 ? conference.Acronym : talk.Tags[0];
- var logoPath = System.IO.Path.Combine(c3stream.CachePath, conference.Acronym, "logo.png");
+ var isWatched = state == "watched";
+ var isMarked = state == "marked";
+ var file = $"{talk.Slug}.mp4";
+ var conference = c3stream.GetConferenceByEventGuid(talk.Guid);
- var category = talk.Tags.Count switch {
- 0 => "",
- 1 => talk.Tags[0],
- 2 => "",
- 3 => talk.Tags[2],
- 4 => talk.Tags[3],
- 5 => talk.Tags[3],
- 6 => talk.Tags[3], // rc3: is this correct?
- _ => ""
- };
+ var eventName = talk.Tags.Count <= 1 ? conference.Acronym : talk.Tags[0];
+ var logoPath = System.IO.Path.Combine(c3stream.CachePath, conference.Acronym, "logo.png");
+
+ var category = talk.Tags.Count switch {
+ 0 => "",
+ 1 => talk.Tags[0],
+ 2 => "",
+ 3 => talk.Tags[2],
+ 4 => talk.Tags[3],
+ 5 => talk.Tags[3],
+ 6 => talk.Tags[3], // rc3: is this correct?
+ _ => ""
+ };
}
@if (System.IO.File.Exists(logoPath)) {
-
+
}
else {
-
+
}
@if (isWatched) {
-