From 29f9538066cf49a67447a83359ae2db1b5cc2e91 Mon Sep 17 00:00:00 2001 From: Francesco <100066266+cranci1@users.noreply.github.com> Date: Sat, 17 May 2025 16:59:50 +0200 Subject: [PATCH] modules type support now --- Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift b/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift index 5a6c557..b84fcb1 100644 --- a/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift +++ b/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift @@ -114,7 +114,10 @@ struct EpisodeCell: View { } .onAppear { updateProgress() - fetchEpisodeDetails() + + if let type = module.metadata.type?.lowercased(), type == "anime" { + fetchAnimeEpisodeDetails() + } } .onChange(of: progress) { _ in updateProgress() @@ -152,10 +155,6 @@ struct EpisodeCell: View { currentProgress = totalTime > 0 ? min(lastPlayedTime / totalTime, 1.0) : 0 } - private func fetchEpisodeDetails() { - fetchAnimeEpisodeDetails() - } - private func fetchAnimeEpisodeDetails() { guard let url = URL(string: "https://api.ani.zip/mappings?anilist_id=\(itemID)") else { isLoading = false