diff --git a/src/modules/imageresizer/ui/App.xaml.cs b/src/modules/imageresizer/ui/App.xaml.cs index 06c8eebad5..9977a8a474 100644 --- a/src/modules/imageresizer/ui/App.xaml.cs +++ b/src/modules/imageresizer/ui/App.xaml.cs @@ -188,31 +188,8 @@ namespace ImageResizer /// private static AiAvailabilityState CheckAiAvailability() { - try - { - // Check Windows AI service model ready state - // it's so slow, why? - var readyState = Services.WinAiSuperResolutionService.GetModelReadyState(); - - // Map AI service state to our availability state - switch (readyState) - { - case Microsoft.Windows.AI.AIFeatureReadyState.Ready: - return AiAvailabilityState.Ready; - - case Microsoft.Windows.AI.AIFeatureReadyState.NotReady: - return AiAvailabilityState.ModelNotReady; - - case Microsoft.Windows.AI.AIFeatureReadyState.DisabledByUser: - case Microsoft.Windows.AI.AIFeatureReadyState.NotSupportedOnCurrentSystem: - default: - return AiAvailabilityState.NotSupported; - } - } - catch (Exception) - { - return AiAvailabilityState.NotSupported; - } + // AI feature disabled - always return NotSupported + return AiAvailabilityState.NotSupported; } /// diff --git a/src/modules/imageresizer/ui/Services/AiAvailabilityCacheService.cs b/src/modules/imageresizer/ui/Services/AiAvailabilityCacheService.cs index d1a235297e..474d1c398e 100644 --- a/src/modules/imageresizer/ui/Services/AiAvailabilityCacheService.cs +++ b/src/modules/imageresizer/ui/Services/AiAvailabilityCacheService.cs @@ -39,29 +39,8 @@ namespace ImageResizer.Services /// public static AiAvailabilityState? LoadCache() { - try - { - if (!File.Exists(CachePath)) - { - return null; - } - - var json = File.ReadAllText(CachePath); - var cache = JsonSerializer.Deserialize(json); - - if (!IsCacheValid(cache)) - { - return null; - } - - return (AiAvailabilityState)cache.State; - } - catch (Exception ex) - { - // Read failure (file locked, corrupted JSON, etc.) - return null and use fallback - Logger.LogError($"Failed to load AI cache: {ex.Message}"); - return null; - } + // Cache disabled - always return null to use default value + return null; } /// @@ -70,32 +49,8 @@ namespace ImageResizer.Services /// public static void SaveCache(AiAvailabilityState state) { - try - { - var cache = new AiCapabilityCache - { - Version = CacheVersion, - State = (int)state, - WindowsBuild = Environment.OSVersion.Version.ToString(), - Architecture = RuntimeInformation.ProcessArchitecture.ToString(), - Timestamp = DateTime.UtcNow.ToString("o"), - }; - - var dir = Path.GetDirectoryName(CachePath); - if (!Directory.Exists(dir)) - { - Directory.CreateDirectory(dir); - } - - var json = JsonSerializer.Serialize(cache, SerializerOptions); - File.WriteAllText(CachePath, json); - - Logger.LogInfo($"AI cache saved: {state}"); - } - catch (Exception ex) - { - Logger.LogError($"Failed to save AI cache: {ex.Message}"); - } + // Cache disabled - do not save anything + return; } ///