From 2eeeaaaaf559915b0b01c643abe2324db699e91d Mon Sep 17 00:00:00 2001 From: scigward Date: Sun, 17 Aug 2025 10:21:15 +0300 Subject: [PATCH] I don't know if this will work or not --- Sora/Views/MediaInfoView/MediaInfoView.swift | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Sora/Views/MediaInfoView/MediaInfoView.swift b/Sora/Views/MediaInfoView/MediaInfoView.swift index 7eaa0cb..224bd4d 100644 --- a/Sora/Views/MediaInfoView/MediaInfoView.swift +++ b/Sora/Views/MediaInfoView/MediaInfoView.swift @@ -37,13 +37,6 @@ struct MediaInfoView: View { // Jikan filler set for this media (passed down to EpisodeCell) @State private var jikanFillerSet: Set? = nil - // Static/shared Jikan cache & progress guards (one cache for the app to avoid duplicate/expensive fetches) - private static var jikanCache: [Int: (fetchedAt: Date, episodes: [JikanEpisode])] = [:] - private static let jikanCacheQueue = DispatchQueue(label: "sora.jikan.cache.queue", attributes: .concurrent) - private static let jikanCacheTTL: TimeInterval = 60 * 60 * 24 * 7 // 1 week - private static var inProgressMALIDs: Set = [] - private static let inProgressQueue = DispatchQueue(label: "sora.jikan.inprogress.queue") - // Track fetched pages for MAL ID private static var fetchedPagesForMALID: [Int: Set] = [:] @@ -2514,6 +2507,9 @@ struct MediaInfoView: View { let filler: Bool } + // Track fetched pages for MAL ID + private static var fetchedPagesForMALID: [Int: Set] = [:] + private func fetchRequiredFillerPages() { guard let malID = matchedMalID ?? itemID else { Logger.shared.log("MAL ID not available for filler info", type: "Debug") @@ -2525,8 +2521,10 @@ struct MediaInfoView: View { Self.fetchedPagesForMALID[malID] = Set() } - // Calculate which pages we need based on current episode range + // Get the current episode list (for the selected season) let currentEpisodes = currentEpisodeList + + // Calculate which pages we need based on current episode range let episodesInRange = currentEpisodes[selectedRange].map { $0.number } guard let minEpisode = episodesInRange.min(),