From cc6a24d65c1a14ef28a949a3f0e655f50bc0e50c Mon Sep 17 00:00:00 2001 From: cranci1 <100066266+cranci1@users.noreply.github.com> Date: Sun, 15 Jun 2025 17:30:42 +0200 Subject: [PATCH] fixed fetch metadata when off --- .../MediaInfoView/EpisodeCell/EpisodeCell.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift b/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift index f8024d1..76bb07c 100644 --- a/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift +++ b/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift @@ -794,6 +794,14 @@ private extension EpisodeCell { private extension EpisodeCell { func fetchAnimeEpisodeDetails() { + if let fetchMeta = UserDefaults.standard.object(forKey: "fetchEpisodeMetadata"), + !(fetchMeta as? Bool ?? true) { + DispatchQueue.main.async { + self.isLoading = false + self.retryAttempts = 0 + } + return + } guard let url = URL(string: "https://api.ani.zip/mappings?anilist_id=\(itemID)") else { isLoading = false Logger.shared.log("Invalid URL for itemID: \(itemID)", type: "Error") @@ -870,6 +878,13 @@ private extension EpisodeCell { } func fetchTMDBEpisodeImage() { + if let fetchMeta = UserDefaults.standard.object(forKey: "fetchEpisodeMetadata"), + !(fetchMeta as? Bool ?? true) { + DispatchQueue.main.async { + self.isLoading = false + } + return + } guard let tmdbID = tmdbID, let season = seasonNumber else { return } let episodeNum = episodeID + 1