From de617d47fe6d4f9f40f6d23e50d6ae6c07a55c15 Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 14 Jan 2025 14:23:14 +0000 Subject: [PATCH] Updated `CreateRouteMapping` to use `FileUtil` --- Core/Utils/DatabaseImporter.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Core/Utils/DatabaseImporter.cs b/Core/Utils/DatabaseImporter.cs index 30a2c2e0..0f3fc412 100644 --- a/Core/Utils/DatabaseImporter.cs +++ b/Core/Utils/DatabaseImporter.cs @@ -18,19 +18,19 @@ public class DatabaseImporter : OnLoad private object hashedFile; private ValidationResult valid = ValidationResult.UNDEFINED; private string filepath; - protected HttpConfig httpConfig; + private HttpConfig httpConfig; - protected readonly ILogger _logger; - protected readonly LocalisationService _localisationService; + private readonly ILogger _logger; + private readonly LocalisationService _localisationService; - protected readonly DatabaseServer _databaseServer; + private readonly DatabaseServer _databaseServer; - protected readonly ImageRouter _imageRouter; - protected readonly EncodingUtil _encodingUtil; - protected readonly HashUtil _hashUtil; - protected readonly ImporterUtil _importerUtil; - protected readonly ConfigServer _configServer; - protected readonly FileUtil _fileUtil; + private readonly ImageRouter _imageRouter; + private readonly EncodingUtil _encodingUtil; + private readonly HashUtil _hashUtil; + private readonly ImporterUtil _importerUtil; + private readonly ConfigServer _configServer; + private readonly FileUtil _fileUtil; public DatabaseImporter( ILogger logger, @@ -103,7 +103,7 @@ public class DatabaseImporter : OnLoad var directoryContent = GetAllFilesInDirectory(directory); foreach (var fileNameWithPath in directoryContent) { - var bsgPath = $"/{newBasePath}/{Path.GetFileNameWithoutExtension(fileNameWithPath)}"; + var bsgPath = $"/{newBasePath}/{_fileUtil.StripExtension(fileNameWithPath)}"; var sptPath = $"{directory}{ fileNameWithPath}"; _imageRouter.AddRoute(bsgPath, sptPath); }