diff --git a/ProjectLighthouse/Extensions/ConsoleColorExtensions.cs b/ProjectLighthouse/Extensions/ConsoleColorExtensions.cs deleted file mode 100644 index b1657687..00000000 --- a/ProjectLighthouse/Extensions/ConsoleColorExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace LBPUnion.ProjectLighthouse.Extensions; - -internal static class ConsoleColorExtensions -{ - internal static ConsoleColor ToDark(this ConsoleColor color) - => color switch - { - ConsoleColor.Blue => ConsoleColor.DarkBlue, - ConsoleColor.Cyan => ConsoleColor.DarkCyan, - ConsoleColor.Green => ConsoleColor.DarkGreen, - ConsoleColor.Gray => ConsoleColor.DarkGray, - ConsoleColor.Magenta => ConsoleColor.DarkMagenta, - ConsoleColor.Red => ConsoleColor.DarkRed, - ConsoleColor.White => ConsoleColor.Gray, - ConsoleColor.Yellow => ConsoleColor.DarkYellow, - _ => color, - }; -} \ No newline at end of file diff --git a/ProjectLighthouse/Extensions/RequestExtensions.cs b/ProjectLighthouse/Extensions/RequestExtensions.cs index 324ca2b6..7dcaec93 100644 --- a/ProjectLighthouse/Extensions/RequestExtensions.cs +++ b/ProjectLighthouse/Extensions/RequestExtensions.cs @@ -15,10 +15,11 @@ namespace LBPUnion.ProjectLighthouse.Extensions; public static class RequestExtensions { - // yoinked and adapted from https://stackoverflow.com/a/68641796 #region Mobile Checking + // yoinked and adapted from https://stackoverflow.com/a/68641796 + private static readonly Regex mobileCheck = new ( "Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|PlayStation Vita", diff --git a/ProjectLighthouse/Extensions/StringExtensions.cs b/ProjectLighthouse/Extensions/StringExtensions.cs deleted file mode 100644 index ee1d53b9..00000000 --- a/ProjectLighthouse/Extensions/StringExtensions.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.IO; -using System.Linq; - -namespace LBPUnion.ProjectLighthouse.Extensions; - -public static class StringExtensions -{ - public static string ToFileName(this string text) => Path.GetInvalidFileNameChars().Aggregate(text, (current, c) => current.Replace(c.ToString(), "")); -} \ No newline at end of file diff --git a/ProjectLighthouse/Maintenance/Commands/CreateUserCommand.cs b/ProjectLighthouse/Maintenance/Commands/CreateUserCommand.cs index 775a6cd3..b76dc027 100644 --- a/ProjectLighthouse/Maintenance/Commands/CreateUserCommand.cs +++ b/ProjectLighthouse/Maintenance/Commands/CreateUserCommand.cs @@ -1,6 +1,5 @@ #nullable enable using System.Threading.Tasks; -using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Types; @@ -8,7 +7,6 @@ using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; -[UsedImplicitly] public class CreateUserCommand : ICommand { private readonly Database _database = new(); diff --git a/ProjectLighthouse/Maintenance/Commands/DeleteUserCommand.cs b/ProjectLighthouse/Maintenance/Commands/DeleteUserCommand.cs index fc7c522f..2f1cae47 100644 --- a/ProjectLighthouse/Maintenance/Commands/DeleteUserCommand.cs +++ b/ProjectLighthouse/Maintenance/Commands/DeleteUserCommand.cs @@ -1,13 +1,11 @@ #nullable enable using System; using System.Threading.Tasks; -using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Types; using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; -[UsedImplicitly] public class DeleteUserCommand : ICommand { private readonly Database database = new(); diff --git a/ProjectLighthouse/Maintenance/Commands/MakeUserAdminCommand.cs b/ProjectLighthouse/Maintenance/Commands/MakeUserAdminCommand.cs index ec526e1d..02ac96d5 100644 --- a/ProjectLighthouse/Maintenance/Commands/MakeUserAdminCommand.cs +++ b/ProjectLighthouse/Maintenance/Commands/MakeUserAdminCommand.cs @@ -1,13 +1,11 @@ #nullable enable using System; using System.Threading.Tasks; -using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Types; using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; -[UsedImplicitly] public class MakeUserAdminCommand : ICommand { private readonly Database database = new(); diff --git a/ProjectLighthouse/Maintenance/Commands/ResetPasswordCommand.cs b/ProjectLighthouse/Maintenance/Commands/ResetPasswordCommand.cs index e668a32d..aef0af62 100644 --- a/ProjectLighthouse/Maintenance/Commands/ResetPasswordCommand.cs +++ b/ProjectLighthouse/Maintenance/Commands/ResetPasswordCommand.cs @@ -1,14 +1,12 @@ #nullable enable using System; using System.Threading.Tasks; -using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Types; using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; -[UsedImplicitly] public class ResetPasswordCommand : ICommand { private readonly Database database = new(); diff --git a/ProjectLighthouse/Maintenance/Commands/TestWebhookCommand.cs b/ProjectLighthouse/Maintenance/Commands/TestWebhookCommand.cs index 93ed05b5..e92365d3 100644 --- a/ProjectLighthouse/Maintenance/Commands/TestWebhookCommand.cs +++ b/ProjectLighthouse/Maintenance/Commands/TestWebhookCommand.cs @@ -1,10 +1,8 @@ using System.Threading.Tasks; -using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Helpers; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; -[UsedImplicitly] public class TestWebhookCommand : ICommand { public async Task Run(string[] args) diff --git a/ProjectLighthouse/Maintenance/ICommand.cs b/ProjectLighthouse/Maintenance/ICommand.cs index 03ce547b..29fc63e0 100644 --- a/ProjectLighthouse/Maintenance/ICommand.cs +++ b/ProjectLighthouse/Maintenance/ICommand.cs @@ -1,7 +1,9 @@ using System.Threading.Tasks; +using JetBrains.Annotations; namespace LBPUnion.ProjectLighthouse.Maintenance; +[UsedImplicitly(ImplicitUseTargetFlags.WithInheritors)] public interface ICommand {