diff --git a/Sora/Utils/Cache/KingfisherManager.swift b/Sora/Utils/Cache/KingfisherManager.swift index 7da1d25..4dd5f5d 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 = 16 * 1024 * 1024 + private let maxDiskCacheSize: UInt = 64 * 1024 * 1024 private let maxCacheAgeInDays: TimeInterval = 7 private let imageCachingEnabledKey = "imageCachingEnabled" @@ -39,9 +39,7 @@ class KingfisherCacheManager { @objc private func clearMemoryCacheOnWarning() { KingfisherManager.shared.cache.clearMemoryCache() - KingfisherManager.shared.cache.clearDiskCache { - Logger.shared.log("Cleared memory and disk cache due to memory warning", type: "Debug") - } + Logger.shared.log("Cleared memory cache due to memory warning", type: "Debug") } func configureKingfisher() { @@ -52,7 +50,7 @@ class KingfisherCacheManager { .days(Int(maxCacheAgeInDays)) : .seconds(1) cache.memoryStorage.config.totalCostLimit = isCachingEnabled ? - 4 * 1024 * 1024 : 0 + 12 * 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 75a36cf..8095d0e 100644 --- a/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift +++ b/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift @@ -270,6 +270,7 @@ 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 cab346c..7fbeeea 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 && progress != 0 { + if progress < 0.05 { RoundedRectangle(cornerRadius: 24) .frame(width: 8) } else {