mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 10:51:17 +00:00
Fix load more episodes
This commit is contained in:
@@ -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") ||
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user