modules type support now

This commit is contained in:
Francesco 2025-05-17 16:59:50 +02:00
parent 2b8d3b0cde
commit 29f9538066

View file

@ -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