diff --git a/Program.cs b/Program.cs index 8021e3c..f6d395d 100644 --- a/Program.cs +++ b/Program.cs @@ -30,6 +30,9 @@ if (enableHttpsRedirection) // Enable routing (required for CORS to work with controllers) app.UseRouting(); +// Static files (for wwwroot assets like CSS, JS, images) +app.UseStaticFiles(); + // CORS middleware - MUST be after UseRouting but before MapControllers app.UseCors(); diff --git a/Services/BomRadarService.cs b/Services/BomRadarService.cs index 4e922d9..6fa2a31 100644 --- a/Services/BomRadarService.cs +++ b/Services/BomRadarService.cs @@ -406,7 +406,16 @@ public class BomRadarService : IBomRadarService, IDisposable } } - semaphore.Release(); + // Safely release semaphore - it may be disposed during application shutdown + try + { + semaphore.Release(); + } + catch (ObjectDisposedException) + { + // Semaphore was disposed during shutdown, ignore + _logger.LogDebug("Semaphore was disposed, skipping release"); + } } } diff --git a/Services/TimeParsingService.cs b/Services/TimeParsingService.cs index cff3573..2bb4dd0 100644 --- a/Services/TimeParsingService.cs +++ b/Services/TimeParsingService.cs @@ -190,20 +190,32 @@ public class TimeParsingService : ITimeParsingService } } - // Determine the timezone - use configured timezone if not specified or if it's AEST/AEDT + // Determine the timezone - map AEST/AEDT based on what the BOM website displays + // Note: The BOM website shows the timezone abbreviation for the location being viewed, + // NOT the browser's configured timezone. The browser timezone only affects JavaScript Date operations. TimeZoneInfo tz = _timeZoneInfo; if (!string.IsNullOrEmpty(timezoneStr)) { - // AEST/AEDT are typically the same as Australia/Brisbane or Australia/Sydney - // Both Brisbane and Sydney use AEST/AEDT - if (timezoneStr.Contains("AEST", StringComparison.OrdinalIgnoreCase) || - timezoneStr.Contains("AEDT", StringComparison.OrdinalIgnoreCase)) + // Map timezone abbreviations to actual timezones: + // - "AEST" = UTC+10 (Australian Eastern Standard Time) + // Used by Brisbane year-round, and by Sydney/Melbourne during winter + // Since both are UTC+10 when showing AEST, we use Brisbane timezone (UTC+10 year-round) + // - "AEDT" = UTC+11 (Australian Eastern Daylight Time) + // Used by Sydney/Melbourne during summer (Oct-Apr), never Brisbane + // We use Sydney timezone which handles the UTC+11 offset correctly + if (timezoneStr.Contains("AEST", StringComparison.OrdinalIgnoreCase)) { - tz = _timeZoneInfo; // Use configured timezone + // AEST maps to Brisbane timezone (UTC+10) - works for both Brisbane and Sydney in winter + tz = TimeZoneInfo.FindSystemTimeZoneById("Australia/Brisbane"); + } + else if (timezoneStr.Contains("AEDT", StringComparison.OrdinalIgnoreCase)) + { + // AEDT maps to Sydney timezone (UTC+11) - only appears in summer for Sydney/Melbourne + tz = TimeZoneInfo.FindSystemTimeZoneById("Australia/Sydney"); } else { - // Try to find the timezone, fallback to configured + // Try to find the timezone by name, fallback to configured browser timezone try { tz = TimeZoneInfo.FindSystemTimeZoneById(timezoneStr); diff --git a/Views/RadarTest/Index.cshtml b/Views/RadarTest/Index.cshtml index ddda89b..17687d2 100644 --- a/Views/RadarTest/Index.cshtml +++ b/Views/RadarTest/Index.cshtml @@ -11,707 +11,7 @@