mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-11-23 10:19:39 +00:00
clean up compiler warnings
This commit is contained in:
parent
7d4d3ed89a
commit
d6688fd0c4
@ -12,6 +12,7 @@ using DSharpPlus.CommandsNext;
|
|||||||
using DSharpPlus.CommandsNext.Attributes;
|
using DSharpPlus.CommandsNext.Attributes;
|
||||||
using DSharpPlus.Entities;
|
using DSharpPlus.Entities;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
namespace CompatBot.Commands;
|
namespace CompatBot.Commands;
|
||||||
|
|
||||||
@ -248,7 +249,7 @@ internal partial class Sudo
|
|||||||
if (SandboxDetector.Detect() != SandboxType.Docker)
|
if (SandboxDetector.Detect() != SandboxType.Docker)
|
||||||
{
|
{
|
||||||
Config.Log.Info("Restarting...");
|
Config.Log.Info("Restarting...");
|
||||||
Config.Log.Factory.Flush();
|
LogManager.LogFactory.Flush();
|
||||||
using var self = new Process {StartInfo = RestartInfo};
|
using var self = new Process {StartInfo = RestartInfo};
|
||||||
self.Start();
|
self.Start();
|
||||||
Config.InMemorySettings["shutdown"] = "true";
|
Config.InMemorySettings["shutdown"] = "true";
|
||||||
|
@ -16,6 +16,7 @@ using DSharpPlus.CommandsNext.Attributes;
|
|||||||
using DSharpPlus.Entities;
|
using DSharpPlus.Entities;
|
||||||
using DSharpPlus.Interactivity.Extensions;
|
using DSharpPlus.Interactivity.Extensions;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using NLog;
|
||||||
using SharpCompress.Common;
|
using SharpCompress.Common;
|
||||||
using SharpCompress.Compressors;
|
using SharpCompress.Compressors;
|
||||||
using SharpCompress.Compressors.Deflate;
|
using SharpCompress.Compressors.Deflate;
|
||||||
@ -134,7 +135,7 @@ internal sealed partial class Sudo : BaseCommandModuleCustom
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Config.Log.Factory.Flush();
|
LogManager.LogFactory.Flush();
|
||||||
string[] logPaths = [Config.CurrentLogPath];
|
string[] logPaths = [Config.CurrentLogPath];
|
||||||
if (DateTime.TryParse(date, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out var logDate))
|
if (DateTime.TryParse(date, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out var logDate))
|
||||||
{
|
{
|
||||||
|
@ -75,8 +75,10 @@ public static class DbImporter
|
|||||||
{
|
{
|
||||||
// __EFMigrationsHistory table will be already created by the failed migration attempt
|
// __EFMigrationsHistory table will be already created by the failed migration attempt
|
||||||
#pragma warning disable EF1001 // Internal EF Core API usage.
|
#pragma warning disable EF1001 // Internal EF Core API usage.
|
||||||
|
#pragma warning disable EF1002 // Using raw sql
|
||||||
await db.ExecuteSqlRawAsync($"INSERT INTO `__EFMigrationsHistory`(`MigrationId`,`ProductVersion`) VALUES ({new InitialCreate().GetId()},'manual')", cancellationToken);
|
await db.ExecuteSqlRawAsync($"INSERT INTO `__EFMigrationsHistory`(`MigrationId`,`ProductVersion`) VALUES ({new InitialCreate().GetId()},'manual')", cancellationToken);
|
||||||
await db.ExecuteSqlRawAsync($"INSERT INTO `__EFMigrationsHistory`(`MigrationId`,`ProductVersion`) VALUES ({new Explanations().GetId()},'manual')", cancellationToken);
|
await db.ExecuteSqlRawAsync($"INSERT INTO `__EFMigrationsHistory`(`MigrationId`,`ProductVersion`) VALUES ({new Explanations().GetId()},'manual')", cancellationToken);
|
||||||
|
#pragma warning restore EF1002
|
||||||
#pragma warning restore EF1001 // Internal EF Core API usage.
|
#pragma warning restore EF1001 // Internal EF Core API usage.
|
||||||
// create constraints on moderator
|
// create constraints on moderator
|
||||||
await db.ExecuteSqlRawAsync(@"CREATE TABLE `temp_new_moderator` (
|
await db.ExecuteSqlRawAsync(@"CREATE TABLE `temp_new_moderator` (
|
||||||
|
@ -40,7 +40,7 @@ internal sealed class RarHandler: IArchiveHandler
|
|||||||
while (rarReader.MoveToNextEntry())
|
while (rarReader.MoveToNextEntry())
|
||||||
{
|
{
|
||||||
if (!rarReader.Entry.IsDirectory
|
if (!rarReader.Entry.IsDirectory
|
||||||
&& rarReader.Entry.Key.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
|
&& rarReader.Entry.Key!.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
|
||||||
&& !rarReader.Entry.Key.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
|
&& !rarReader.Entry.Key.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
LogSize = rarReader.Entry.Size;
|
LogSize = rarReader.Entry.Size;
|
||||||
|
@ -40,7 +40,7 @@ internal sealed class SevenZipHandler: IArchiveHandler
|
|||||||
using var zipReader = zipArchive.ExtractAllEntries();
|
using var zipReader = zipArchive.ExtractAllEntries();
|
||||||
while (zipReader.MoveToNextEntry())
|
while (zipReader.MoveToNextEntry())
|
||||||
if (!zipReader.Entry.IsDirectory
|
if (!zipReader.Entry.IsDirectory
|
||||||
&& zipReader.Entry.Key.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
|
&& zipReader.Entry.Key!.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
|
||||||
&& !zipReader.Entry.Key.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
|
&& !zipReader.Entry.Key.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
LogSize = zipReader.Entry.Size;
|
LogSize = zipReader.Entry.Size;
|
||||||
|
@ -41,7 +41,7 @@ internal sealed class ZipHandler: IArchiveHandler
|
|||||||
while (zipReader.MoveToNextEntry())
|
while (zipReader.MoveToNextEntry())
|
||||||
{
|
{
|
||||||
if (!zipReader.Entry.IsDirectory
|
if (!zipReader.Entry.IsDirectory
|
||||||
&& zipReader.Entry.Key.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
|
&& zipReader.Entry.Key!.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
|
||||||
&& !zipReader.Entry.Key.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
|
&& !zipReader.Entry.Key.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
LogSize = zipReader.Entry.Size;
|
LogSize = zipReader.Entry.Size;
|
||||||
|
@ -50,7 +50,7 @@ internal static class ColorGetter
|
|||||||
return defaultColor;
|
return defaultColor;
|
||||||
|
|
||||||
// TODO .net6 breaks this for linux
|
// TODO .net6 breaks this for linux
|
||||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
if (!OperatingSystem.IsWindowsVersionAtLeast(6, 1))
|
||||||
return defaultColor;
|
return defaultColor;
|
||||||
|
|
||||||
var analyzer = new ColorThief();
|
var analyzer = new ColorThief();
|
||||||
|
@ -218,7 +218,7 @@ internal static class AzureDevOpsClientExtensions
|
|||||||
using var zipStream = ReaderFactory.Open(stream);
|
using var zipStream = ReaderFactory.Open(stream);
|
||||||
while (zipStream.MoveToNextEntry() && !cancellationToken.IsCancellationRequested)
|
while (zipStream.MoveToNextEntry() && !cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
if (zipStream.Entry.Key.EndsWith(".7z", StringComparison.InvariantCultureIgnoreCase))
|
if (zipStream.Entry.Key?.EndsWith(".7z", StringComparison.InvariantCultureIgnoreCase) is true)
|
||||||
{
|
{
|
||||||
result = result with {WindowsFilename = Path.GetFileName(zipStream.Entry.Key)};
|
result = result with {WindowsFilename = Path.GetFileName(zipStream.Entry.Key)};
|
||||||
break;
|
break;
|
||||||
@ -248,7 +248,7 @@ internal static class AzureDevOpsClientExtensions
|
|||||||
using var zipStream = ReaderFactory.Open(stream);
|
using var zipStream = ReaderFactory.Open(stream);
|
||||||
while (zipStream.MoveToNextEntry() && !cancellationToken.IsCancellationRequested)
|
while (zipStream.MoveToNextEntry() && !cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
if (zipStream.Entry.Key.EndsWith(".AppImage", StringComparison.InvariantCultureIgnoreCase))
|
if (zipStream.Entry.Key?.EndsWith(".AppImage", StringComparison.InvariantCultureIgnoreCase) is true)
|
||||||
{
|
{
|
||||||
result = result with {LinuxFilename = Path.GetFileName(zipStream.Entry.Key)};
|
result = result with {LinuxFilename = Path.GetFileName(zipStream.Entry.Key)};
|
||||||
break;
|
break;
|
||||||
@ -275,7 +275,7 @@ internal static class AzureDevOpsClientExtensions
|
|||||||
using var zipStream = ReaderFactory.Open(stream);
|
using var zipStream = ReaderFactory.Open(stream);
|
||||||
while (zipStream.MoveToNextEntry() && !cancellationToken.IsCancellationRequested)
|
while (zipStream.MoveToNextEntry() && !cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
if (zipStream.Entry.Key.EndsWith(".dmg", StringComparison.InvariantCultureIgnoreCase))
|
if (zipStream.Entry.Key?.EndsWith(".dmg", StringComparison.InvariantCultureIgnoreCase) is true)
|
||||||
{
|
{
|
||||||
result = result with { MacFilename = Path.GetFileName(zipStream.Entry.Key) };
|
result = result with { MacFilename = Path.GetFileName(zipStream.Entry.Key) };
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user