From 46cca10f2e154bd205f9880ad13fb1967b9a34d1 Mon Sep 17 00:00:00 2001
From: Laura Hausmann
Date: Sun, 20 Nov 2022 17:00:51 +0100
Subject: [PATCH] Code cleanup
---
zotan.pw-web/Migrations.cs | 5 +-
zotan.pw-web/Pages/Error.cshtml | 2 +-
zotan.pw-web/Pages/Error.cshtml.cs | 13 +-
zotan.pw-web/Pages/Index.cshtml | 4 +-
zotan.pw-web/Pages/Index.cshtml.cs | 7 +-
zotan.pw-web/Pages/NowPlaying.cshtml.cs | 8 +-
zotan.pw-web/Pages/Shared/_Layout.cshtml | 8 +-
zotan.pw-web/Pages/_ViewImports.cshtml | 2 +-
zotan.pw-web/Pages/blog/Blog.cshtml | 6 +-
zotan.pw-web/Pages/blog/Blog.cshtml.cs | 10 +-
zotan.pw-web/Pages/blog/BlogPost.cshtml | 2 +-
.../Pages/blog/posts/adhd-and-notes.md | 4 +-
.../Pages/blog/posts/ipv6-networking.md | 8 +-
zotan.pw-web/PlaybackHistory/LogPlayback.cs | 6 +-
zotan.pw-web/Program.cs | 3 +-
zotan.pw-web/Properties/launchSettings.json | 1 -
zotan.pw-web/Travelynx/Travelynx.cs | 6 +-
zotan.pw-web/Travelynx/WebhookRequest.cs | 80 +-
zotan.pw-web/Utils.cs | 2 +-
zotan.pw-web/database/Database.cs | 4 +-
zotan.pw-web/database/Tables/AlbumHistory.cs | 1 +
zotan.pw-web/database/Tables/DbInfo.cs | 2 +-
.../database/Tables/PlaylistHistory.cs | 1 +
zotan.pw-web/wwwroot/files/help.svg | 9175 ++++++++++++-----
zotan.pw-web/zotan.pw-web.csproj | 122 +-
25 files changed, 6905 insertions(+), 2577 deletions(-)
diff --git a/zotan.pw-web/Migrations.cs b/zotan.pw-web/Migrations.cs
index 183f91a..13405c1 100644
--- a/zotan.pw-web/Migrations.cs
+++ b/zotan.pw-web/Migrations.cs
@@ -8,8 +8,7 @@ namespace zotanpw_web;
public static class Migrations {
private const int DbVer = 1;
- private static readonly List _migrations = new() {
- };
+ private static readonly List _migrations = new();
public static void RunMigrations() {
using var db = new Database.DbConn();
@@ -88,4 +87,4 @@ public static class Migrations {
db.Execute(_sql);
}
}
-}
+}
\ No newline at end of file
diff --git a/zotan.pw-web/Pages/Error.cshtml b/zotan.pw-web/Pages/Error.cshtml
index 090dc52..8f24ea4 100644
--- a/zotan.pw-web/Pages/Error.cshtml
+++ b/zotan.pw-web/Pages/Error.cshtml
@@ -22,4 +22,4 @@
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/zotan.pw-web/Pages/Error.cshtml.cs b/zotan.pw-web/Pages/Error.cshtml.cs
index f405c06..2bd8828 100644
--- a/zotan.pw-web/Pages/Error.cshtml.cs
+++ b/zotan.pw-web/Pages/Error.cshtml.cs
@@ -4,19 +4,16 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
namespace zotanpw_web.Pages;
-[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
-[IgnoreAntiforgeryToken]
+[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true), IgnoreAntiforgeryToken]
public class ErrorModel : PageModel {
+ private readonly ILogger _logger;
+
+ public ErrorModel(ILogger logger) => _logger = logger;
+
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
- private readonly ILogger _logger;
-
- public ErrorModel(ILogger logger) {
- _logger = logger;
- }
-
public void OnGet() {
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
diff --git a/zotan.pw-web/Pages/Index.cshtml b/zotan.pw-web/Pages/Index.cshtml
index 2125d23..8e3af70 100644
--- a/zotan.pw-web/Pages/Index.cshtml
+++ b/zotan.pw-web/Pages/Index.cshtml
@@ -158,5 +158,5 @@
@section postfooter {
-
-}
+
+}
\ No newline at end of file
diff --git a/zotan.pw-web/Pages/Index.cshtml.cs b/zotan.pw-web/Pages/Index.cshtml.cs
index f5dff1b..6f93a5c 100644
--- a/zotan.pw-web/Pages/Index.cshtml.cs
+++ b/zotan.pw-web/Pages/Index.cshtml.cs
@@ -1,14 +1,11 @@
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.RazorPages;
+using Microsoft.AspNetCore.Mvc.RazorPages;
namespace zotanpw_web.Pages;
public class IndexModel : PageModel {
private readonly ILogger _logger;
- public IndexModel(ILogger logger) {
- _logger = logger;
- }
+ public IndexModel(ILogger logger) => _logger = logger;
public void OnGet() { }
}
\ No newline at end of file
diff --git a/zotan.pw-web/Pages/NowPlaying.cshtml.cs b/zotan.pw-web/Pages/NowPlaying.cshtml.cs
index a00f342..d65ff2e 100644
--- a/zotan.pw-web/Pages/NowPlaying.cshtml.cs
+++ b/zotan.pw-web/Pages/NowPlaying.cshtml.cs
@@ -1,9 +1,7 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
-namespace zotanpw_web.Pages;
+namespace zotanpw_web.Pages;
public class NowPlayingModel : PageModel {
- public void OnGet() {
-
- }
-}
+ public void OnGet() { }
+}
\ No newline at end of file
diff --git a/zotan.pw-web/Pages/Shared/_Layout.cshtml b/zotan.pw-web/Pages/Shared/_Layout.cshtml
index 607293d..e8ec981 100644
--- a/zotan.pw-web/Pages/Shared/_Layout.cshtml
+++ b/zotan.pw-web/Pages/Shared/_Layout.cshtml
@@ -16,7 +16,7 @@
- @await RenderSectionAsync("head", required: false)
+ @await RenderSectionAsync("head", false)
@@ -26,10 +26,10 @@
-
- @await RenderSectionAsync("prefooter", required: false)
+
+ @await RenderSectionAsync("prefooter", false)
--- Served by @Environment.MachineName running on .NET @Environment.Version ---
- @await RenderSectionAsync("postfooter", required: false)
+ @await RenderSectionAsync("postfooter", false)