diff --git a/Sora/Utils/Cache/KingfisherManager.swift b/Sora/Utils/Cache/KingfisherManager.swift index 4dd5f5d..7da1d25 100644 --- a/Sora/Utils/Cache/KingfisherManager.swift +++ b/Sora/Utils/Cache/KingfisherManager.swift @@ -14,7 +14,7 @@ class KingfisherCacheManager { private let jpegCompressionQuality: CGFloat = 0.7 static let shared = KingfisherCacheManager() - private let maxDiskCacheSize: UInt = 64 * 1024 * 1024 + private let maxDiskCacheSize: UInt = 16 * 1024 * 1024 private let maxCacheAgeInDays: TimeInterval = 7 private let imageCachingEnabledKey = "imageCachingEnabled" @@ -39,7 +39,9 @@ class KingfisherCacheManager { @objc private func clearMemoryCacheOnWarning() { KingfisherManager.shared.cache.clearMemoryCache() - Logger.shared.log("Cleared memory cache due to memory warning", type: "Debug") + KingfisherManager.shared.cache.clearDiskCache { + Logger.shared.log("Cleared memory and disk cache due to memory warning", type: "Debug") + } } func configureKingfisher() { @@ -50,7 +52,7 @@ class KingfisherCacheManager { .days(Int(maxCacheAgeInDays)) : .seconds(1) cache.memoryStorage.config.totalCostLimit = isCachingEnabled ? - 12 * 1024 * 1024 : 0 + 4 * 1024 * 1024 : 0 cache.memoryStorage.config.cleanInterval = 60 diff --git a/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift b/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift index c576bb2..50a6b68 100644 --- a/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift +++ b/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift @@ -270,7 +270,6 @@ struct EpisodeCell: View { .onFailure { error in Logger.shared.log("Failed to load episode image: \(error)", type: "Error") } - .cacheMemoryOnly(!KingfisherCacheManager.shared.isCachingEnabled) .resizable() .aspectRatio(16/9, contentMode: .fill) .frame(width: 100, height: 56) diff --git a/Sora/Views/MediaInfoView/MediaInfoView.swift b/Sora/Views/MediaInfoView/MediaInfoView.swift index bda396d..a51b4e8 100644 --- a/Sora/Views/MediaInfoView/MediaInfoView.swift +++ b/Sora/Views/MediaInfoView/MediaInfoView.swift @@ -616,7 +616,7 @@ struct MediaInfoView: View { .frame(width: max(width * CGFloat(progress), 8), height: 48) .mask( HStack { - if progress < 0.05 { + if progress < 0.05 && progress != 0 { RoundedRectangle(cornerRadius: 24) .frame(width: 8) } else {