diff --git a/SpleeterAPI.csproj b/SpleeterAPI.csproj index d79eb04..a6a8751 100644 --- a/SpleeterAPI.csproj +++ b/SpleeterAPI.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 770f53e5-6b9c-4a58-b73c-528f7f74dc1d false AspNetCoreModuleV2 @@ -68,13 +68,13 @@ - - - - - - - + + + + + + + diff --git a/Split/GeoLocationHelper.cs b/Split/GeoLocationHelper.cs index 10ac87a..458ab31 100644 --- a/Split/GeoLocationHelper.cs +++ b/Split/GeoLocationHelper.cs @@ -29,8 +29,8 @@ public static string GetGeoLocation(string ip) public static async Task GetIpInfo(string ip) { - IpInfo info; - if (!_ipInfoCache.TryGetValue(ip, out info)) + IpInfo info = null; + if (ip.Length > 5 && !_ipInfoCache.TryGetValue(ip, out info)) { info = await _client.Lookup(ip); _ipInfoCache.TryAdd(ip, info); diff --git a/Startup/Startup.cs b/Startup/Startup.cs index 151ca11..c6c6e2c 100644 --- a/Startup/Startup.cs +++ b/Startup/Startup.cs @@ -12,6 +12,7 @@ using System.IO; using Microsoft.OpenApi.Models; using System.Linq; +using System.Text.Json.Serialization; namespace SpleeterAPI { @@ -41,7 +42,7 @@ public void ConfigureServices(IServiceCollection services) services.AddControllers() .AddJsonOptions(json => { - json.JsonSerializerOptions.IgnoreNullValues = true; + json.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; json.JsonSerializerOptions.WriteIndented = true; }); @@ -142,10 +143,11 @@ public static void EphemeralLog(string text, bool important) } Console.WriteLine(text); - Audit.Core.AuditScope.CreateAndSave("Ephemeral", new { Status = text }); + Audit.Core.AuditScope.Log("Ephemeral", new { Status = text }); } - private static object _fleLogLocker = new object(); + private static readonly object _fleLogLocker = new object(); + public static void FileLog(string text, bool noAppend = false) { var logFile = GetFileLogPath(); diff --git a/appsettings.json b/appsettings.json index c4e95d8..1b7eec6 100644 --- a/appsettings.json +++ b/appsettings.json @@ -28,11 +28,11 @@ }, "Kestrel": { "Certificates": { - "Default": { - "Subject": "spl.eastus.cloudapp.azure.com", - "Store": "Root", - "Location": "LocalMachine" - } + //"Default": { + // "Subject": "spl.eastus.cloudapp.azure.com", + // "Store": "Root", + // "Location": "LocalMachine" + //} } }, "AllowedHosts": "*" diff --git a/docs/splitter.js b/docs/splitter.js index 88c0f5d..19c018f 100644 --- a/docs/splitter.js +++ b/docs/splitter.js @@ -2,9 +2,9 @@ var buttonSplit = $("#btn-split"); var max_duration_mins = 30; -var split_yt_api = 'https://spl.eastus.cloudapp.azure.com/yt'; -var split_test_api = 'https://spl.eastus.cloudapp.azure.com/test'; -var split_mp3_api = 'https://spl.eastus.cloudapp.azure.com/mp3'; +var split_yt_api = 'https://localhost:7280/yt'; +var split_test_api = 'https://localhost:7280/test'; +var split_mp3_api = 'https://localhost:7280/mp3'; var selectedFiles = []; var dropzone;