Fix load more episodes

This commit is contained in:
kodjomoustapha
2024-01-04 18:16:54 +01:00
parent 8d3b79251c
commit 4254c63f71
2 changed files with 24 additions and 1 deletions

View File

@@ -85,6 +85,29 @@ class AniFlix extends MProvider {
List<MChapter>? episodesList = []; List<MChapter>? episodesList = [];
for (var season in seasons) { for (var season in seasons) {
List<Map<String, dynamic>> episodes = season["episodes"]; List<Map<String, dynamic>> episodes = season["episodes"];
int page = 1;
final res = await http(
'GET',
json.encode({
"url": "${source.baseUrl}/api/show/$animeUrl/${season["id"]}/$page"
}));
bool hasMoreResult =
(json.decode(res)["episodes"] as List<Map<String, dynamic>>)
.isNotEmpty;
while (hasMoreResult) {
final res = await http(
'GET',
json.encode({
"url":
"${source.baseUrl}/api/show/$animeUrl/${season["id"]}/$page"
}));
final epList =
json.decode(res)["episodes"] as List<Map<String, dynamic>>;
page++;
episodes.addAll(epList);
hasMoreResult = epList.isNotEmpty;
}
for (var episode in episodes) { for (var episode in episodes) {
String name = episode["name"] ?? ""; String name = episode["name"] ?? "";
if (name.toLowerCase().contains("folge") || if (name.toLowerCase().contains("folge") ||

View File

@@ -1,7 +1,7 @@
import '../../../../model/source.dart'; import '../../../../model/source.dart';
Source get aniflix => _aniflix; Source get aniflix => _aniflix;
const _aniflixVersion = "0.0.1"; const _aniflixVersion = "0.0.15";
const _aniflixCodeUrl = const _aniflixCodeUrl =
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/anime/src/de/aniflix/aniflix.dart"; "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/anime/src/de/aniflix/aniflix.dart";
Source _aniflix = Source( Source _aniflix = Source(