mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 19:01:15 +00:00
Fix nepnep map index error
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -35,7 +35,7 @@ class NepNep extends MProvider {
|
|||||||
final resSort = sortMapList(json.decode(directory), "lt", 1);
|
final resSort = sortMapList(json.decode(directory), "lt", 1);
|
||||||
final datas = json.decode(resSort) as List;
|
final datas = json.decode(resSort) as List;
|
||||||
final queryRes = datas.where((e) {
|
final queryRes = datas.where((e) {
|
||||||
String name = e['s'];
|
String name = getMapValue(e, 's');
|
||||||
return name.toLowerCase().contains(query.toLowerCase());
|
return name.toLowerCase().contains(query.toLowerCase());
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
@@ -74,18 +74,19 @@ class NepNep extends MProvider {
|
|||||||
List<MChapter> chaptersList = [];
|
List<MChapter> chaptersList = [];
|
||||||
|
|
||||||
for (var ch in chapters) {
|
for (var ch in chapters) {
|
||||||
|
final c = json.encode(ch);
|
||||||
MChapter chapter = MChapter();
|
MChapter chapter = MChapter();
|
||||||
String name = ch['ChapterName'] ?? "";
|
String name = getMapValue(c, 'ChapterName');
|
||||||
String indexChapter = ch['Chapter'];
|
String indexChapter = getMapValue(c, 'Chapter');
|
||||||
if (name.isEmpty) {
|
if (name.isEmpty) {
|
||||||
name = '${ch['Type']} ${chapterImage(indexChapter, true)}';
|
name = '${getMapValue(c, 'Type')} ${chapterImage(indexChapter, true)}';
|
||||||
}
|
}
|
||||||
chapter.name = name;
|
chapter.name = name == "null" ? "" : name;
|
||||||
chapter.url =
|
chapter.url =
|
||||||
'/read-online/${substringAfter(url, "/manga/")}${chapterURLEncode(ch['Chapter'])}';
|
'/read-online/${substringAfter(url, "/manga/")}${chapterURLEncode(getMapValue(c, 'Chapter'))}';
|
||||||
chapter.dateUpload =
|
chapter.dateUpload = parseDates([getMapValue(c, 'Date')],
|
||||||
parseDates([ch['Date']], source.dateFormat, source.dateFormatLocale)
|
source.dateFormat, source.dateFormatLocale)
|
||||||
.first;
|
.first;
|
||||||
chaptersList.add(chapter);
|
chaptersList.add(chapter);
|
||||||
}
|
}
|
||||||
manga.chapters = chaptersList;
|
manga.chapters = chaptersList;
|
||||||
@@ -101,18 +102,20 @@ class NepNep extends MProvider {
|
|||||||
final res = await http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
final script =
|
final script =
|
||||||
xpath(res, '//script[contains(text(), "MainFunction")]/text()').first;
|
xpath(res, '//script[contains(text(), "MainFunction")]/text()').first;
|
||||||
final chapScript = json.decode(
|
final chapScript =
|
||||||
substringBefore(substringAfter(script, "vm.CurChapter = "), ";"));
|
substringBefore(substringAfter(script, "vm.CurChapter = "), ";");
|
||||||
final pathName = substringBefore(
|
final pathName = substringBefore(
|
||||||
substringAfter(script, "vm.CurPathName = \"", ""), "\"");
|
substringAfter(script, "vm.CurPathName = \"", ""), "\"");
|
||||||
var directory = chapScript['Directory'] ?? '';
|
var directory = getMapValue(chapScript, 'Directory') == 'null'
|
||||||
|
? ''
|
||||||
|
: getMapValue(chapScript, 'Directory');
|
||||||
if (directory.length > 0) {
|
if (directory.length > 0) {
|
||||||
directory += '/';
|
directory += '/';
|
||||||
}
|
}
|
||||||
final mangaName =
|
final mangaName =
|
||||||
substringBefore(substringAfter(url, "/read-online/"), "-chapter");
|
substringBefore(substringAfter(url, "/read-online/"), "-chapter");
|
||||||
var chNum = chapterImage(chapScript['Chapter'], false);
|
var chNum = chapterImage(getMapValue(chapScript, 'Chapter'), false);
|
||||||
var totalPages = int.parse(chapScript['Page']);
|
var totalPages = int.parse(getMapValue(chapScript, 'Page'));
|
||||||
for (int page = 1; page <= totalPages; page++) {
|
for (int page = 1; page <= totalPages; page++) {
|
||||||
String paddedPageNumber = "$page".padLeft(3, '0');
|
String paddedPageNumber = "$page".padLeft(3, '0');
|
||||||
String pageUrl =
|
String pageUrl =
|
||||||
@@ -135,10 +138,12 @@ class NepNep extends MProvider {
|
|||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final datas = json.decode(res) as List;
|
final datas = json.decode(res) as List;
|
||||||
for (var data in datas) {
|
for (var data in datas) {
|
||||||
|
final d = json.encode(data);
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
manga.name = data["s"];
|
manga.name = getMapValue(d, "s");
|
||||||
manga.imageUrl = 'https://temp.compsci88.com/cover/${data['i']}.jpg';
|
manga.imageUrl =
|
||||||
manga.link = data["i"];
|
'https://temp.compsci88.com/cover/${getMapValue(d, "i")}.jpg';
|
||||||
|
manga.link = getMapValue(d, "i");
|
||||||
mangaList.add(manga);
|
mangaList.add(manga);
|
||||||
}
|
}
|
||||||
return MPages(mangaList, true);
|
return MPages(mangaList, true);
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import '../../../model/source.dart';
|
import '../../../model/source.dart';
|
||||||
import '../../../utils/utils.dart';
|
import '../../../utils/utils.dart';
|
||||||
|
|
||||||
const nepnepVersion = "0.0.25";
|
const nepnepVersion = "0.0.3";
|
||||||
const nepnepSourceCodeUrl =
|
const nepnepSourceCodeUrl =
|
||||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/multisrc/nepnep/nepnep-v$nepnepVersion.dart";
|
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/multisrc/nepnep/nepnep-v$nepnepVersion.dart";
|
||||||
const defaultDateFormat = "yyyy-MM-dd HH:mm:ss";
|
const defaultDateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
|||||||
Reference in New Issue
Block a user