mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 02:41:39 +00:00
refactor
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -2,9 +2,8 @@ import 'package:bridge_lib/bridge_lib.dart';
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
String getMDXContentRating() {
|
String getMDXContentRating() {
|
||||||
String ctnRating = MBridge.stringParse(
|
String ctnRating =
|
||||||
"&contentRating[]=suggestive&contentRating[]=safe&contentRating[]=erotica&contentRating[]=pornographic",
|
"&contentRating[]=suggestive&contentRating[]=safe&contentRating[]=erotica&contentRating[]=pornographic";
|
||||||
0);
|
|
||||||
return ctnRating;
|
return ctnRating;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,35 +38,35 @@ getPopularManga(MangaModel manga) async {
|
|||||||
|
|
||||||
MangaModel getChapters(
|
MangaModel getChapters(
|
||||||
MangaModel manga, int length, String paginatedChapterListA) {
|
MangaModel manga, int length, String paginatedChapterListA) {
|
||||||
String scanlators = MBridge.stringParse("", 0);
|
String scanlators = "".toString();
|
||||||
String chapNames = MBridge.stringParse("", 0);
|
String chapNames = "".toString();
|
||||||
String chapDate = MBridge.stringParse("", 0);
|
String chapDate = "".toString();
|
||||||
String chapterUrl = MBridge.stringParse("", 0);
|
String chapterUrl = "".toString();
|
||||||
String paginatedChapterList = MBridge.stringParse(paginatedChapterListA, 0);
|
String paginatedChapterList = paginatedChapterListA.toString();
|
||||||
final dataList =
|
final dataList =
|
||||||
MBridge.jsonPathToList(paginatedChapterList, r'$.data[*]', 0);
|
MBridge.jsonPathToList(paginatedChapterList, r'$.data[*]', 0);
|
||||||
for (var res in dataList) {
|
for (var res in dataList) {
|
||||||
String scan = MBridge.stringParse("", 0);
|
String scan = "".toString();
|
||||||
final groups = MBridge.jsonPathToList(res,
|
final groups = MBridge.jsonPathToList(res,
|
||||||
r'$.relationships[?@.id!="00e03853-1b96-4f41-9542-c71b8692033b"]', 0);
|
r'$.relationships[?@.id!="00e03853-1b96-4f41-9542-c71b8692033b"]', 0);
|
||||||
String chapName = MBridge.stringParse("", 0);
|
String chapName = "".toString();
|
||||||
for (var element in groups) {
|
for (var element in groups) {
|
||||||
final data = MBridge.getMapValue(element, "attributes", 1);
|
final data = MBridge.getMapValue(element, "attributes", 1);
|
||||||
if (data.isEmpty) {
|
if (data.isEmpty) {
|
||||||
} else {
|
} else {
|
||||||
final name = MBridge.getMapValue(data, "name", 0);
|
final name = MBridge.getMapValue(data, "name", 0);
|
||||||
scan += MBridge.stringParse("$name", 0);
|
scan += "$name".toString();
|
||||||
final username = MBridge.getMapValue(data, "username", 0);
|
final username = MBridge.getMapValue(data, "username", 0);
|
||||||
if (username.isEmpty) {
|
if (username.isEmpty) {
|
||||||
} else {
|
} else {
|
||||||
if (scan.isEmpty) {
|
if (scan.isEmpty) {
|
||||||
scan += MBridge.stringParse("Uploaded by $username", 0);
|
scan += "Uploaded by $username".toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scan.isEmpty) {
|
if (scan.isEmpty) {
|
||||||
scan = MBridge.stringParse("No Group", 0);
|
scan = "No Group".toString();
|
||||||
}
|
}
|
||||||
final dataRes = MBridge.getMapValue(res, "attributes", 1);
|
final dataRes = MBridge.getMapValue(res, "attributes", 1);
|
||||||
if (dataRes.isEmpty) {
|
if (dataRes.isEmpty) {
|
||||||
@@ -78,7 +77,7 @@ MangaModel getChapters(
|
|||||||
} else {
|
} else {
|
||||||
if (volume == "null") {
|
if (volume == "null") {
|
||||||
} else {
|
} else {
|
||||||
chapName = MBridge.stringParse("Vol.$volume ", 0);
|
chapName = "Vol.$volume ".toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final chapter = MBridge.getMapValue(data, "chapter", 0);
|
final chapter = MBridge.getMapValue(data, "chapter", 0);
|
||||||
@@ -86,7 +85,7 @@ MangaModel getChapters(
|
|||||||
} else {
|
} else {
|
||||||
if (chapter == "null") {
|
if (chapter == "null") {
|
||||||
} else {
|
} else {
|
||||||
chapName += MBridge.stringParse("Ch.$chapter ", 0);
|
chapName += "Ch.$chapter ".toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final title = MBridge.getMapValue(data, "title", 0);
|
final title = MBridge.getMapValue(data, "title", 0);
|
||||||
@@ -96,13 +95,13 @@ MangaModel getChapters(
|
|||||||
} else {
|
} else {
|
||||||
if (chapName.isEmpty) {
|
if (chapName.isEmpty) {
|
||||||
} else {
|
} else {
|
||||||
chapName += MBridge.stringParse("- ", 0);
|
chapName += "- ".toString();
|
||||||
}
|
}
|
||||||
chapName += MBridge.stringParse("$title", 0);
|
chapName += "$title".toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chapName.isEmpty) {
|
if (chapName.isEmpty) {
|
||||||
chapName += MBridge.stringParse("Oneshot", 0);
|
chapName += "Oneshot".toString();
|
||||||
}
|
}
|
||||||
final date = MBridge.getMapValue(data, "publishAt", 0);
|
final date = MBridge.getMapValue(data, "publishAt", 0);
|
||||||
final id = MBridge.getMapValue(res, "id", 0);
|
final id = MBridge.getMapValue(res, "id", 0);
|
||||||
@@ -263,7 +262,7 @@ getLatestUpdatesManga(MangaModel manga) async {
|
|||||||
MBridge.jsonPathToString(ress, r'$.data[*].relationships[*].id', '.--')
|
MBridge.jsonPathToString(ress, r'$.data[*].relationships[*].id', '.--')
|
||||||
.split('.--'),
|
.split('.--'),
|
||||||
3);
|
3);
|
||||||
String mangaa = MBridge.stringParse("", 0);
|
String mangaa = "".toString();
|
||||||
for (var id in mangaIds) {
|
for (var id in mangaIds) {
|
||||||
mangaa += "&ids[]=$id";
|
mangaa += "&ids[]=$id";
|
||||||
}
|
}
|
||||||
@@ -385,7 +384,7 @@ String getCover(String dataRes, int mangaIndex, String mangaId) {
|
|||||||
MBridge.jsonPathToString(dataRes, expressionRelationAll, '_.')
|
MBridge.jsonPathToString(dataRes, expressionRelationAll, '_.')
|
||||||
.split("_."),
|
.split("_."),
|
||||||
0);
|
0);
|
||||||
String coverFileName = MBridge.stringParse("", 0);
|
String coverFileName = "".toString();
|
||||||
for (var j = 0; j < relationDatas.length; j++) {
|
for (var j = 0; j < relationDatas.length; j++) {
|
||||||
final expressionData = MBridge.regExp(
|
final expressionData = MBridge.regExp(
|
||||||
r'$.data[a].relationships[b]', r'\[a\]', "[$mangaIndex]", 0, 1);
|
r'$.data[a].relationships[b]', r'\[a\]', "[$mangaIndex]", 0, 1);
|
||||||
@@ -3,7 +3,7 @@ import '../../../../model/source.dart';
|
|||||||
const apiUrl = 'https://api.mangadex.org';
|
const apiUrl = 'https://api.mangadex.org';
|
||||||
const baseUrl = 'https://mangadex.org';
|
const baseUrl = 'https://mangadex.org';
|
||||||
const isNsfw = true;
|
const isNsfw = true;
|
||||||
const mangadexVersion = "0.0.12";
|
const mangadexVersion = "0.0.13";
|
||||||
const mangadexSourceCodeUrl =
|
const mangadexSourceCodeUrl =
|
||||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/src/all/mangadex/mangadex-v$mangadexVersion.dart";
|
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/src/all/mangadex/mangadex-v$mangadexVersion.dart";
|
||||||
const iconUrl = 'https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/icon/mangayomi-all-mangadex.png';
|
const iconUrl = 'https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/icon/mangayomi-all-mangadex.png';
|
||||||
|
|||||||
Reference in New Issue
Block a user