diff --git a/Harmonia.Core/Caching/AudioImageMemoryCache.cs b/Harmonia.Core/Caching/AudioImageMemoryCache.cs index e671863..1ab1510 100644 --- a/Harmonia.Core/Caching/AudioImageMemoryCache.cs +++ b/Harmonia.Core/Caching/AudioImageMemoryCache.cs @@ -5,6 +5,10 @@ namespace Harmonia.Core.Caching; public class AudioImageMemoryCache(IAudioImageExtractor audioImageExtractor) : MemoryCache, IAudioImageCache { + protected override long? SizeLimit => 2000000000; + protected override double CompactionPercentage => 0.2; + protected override TimeSpan SlidingExpiration => TimeSpan.FromSeconds(600); + protected override object? GetKey(Song key) { if (string.IsNullOrWhiteSpace(key.ImageHash) == false) diff --git a/Harmonia.Core/Caching/MemoryCache.cs b/Harmonia.Core/Caching/MemoryCache.cs index 091e964..5af8900 100644 --- a/Harmonia.Core/Caching/MemoryCache.cs +++ b/Harmonia.Core/Caching/MemoryCache.cs @@ -6,9 +6,9 @@ public abstract class MemoryCache : Cache where TKey { private readonly IMemoryCache _memoryCache; - protected virtual long? SizeLimit => 2000000000; - protected virtual double CompactionPercentage => 0.2; - protected virtual TimeSpan SlidingExpiration => TimeSpan.FromSeconds(600); + protected abstract long? SizeLimit { get; } + protected abstract double CompactionPercentage { get; } + protected abstract TimeSpan SlidingExpiration { get; } public MemoryCache() {