mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-03-11 21:35:32 +00:00
Update
This commit is contained in:
parent
532d86129d
commit
b713d844d6
5 changed files with 19 additions and 27 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 78 KiB |
|
|
@ -312,7 +312,7 @@ class MBridge {
|
||||||
return html!;
|
return html!;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Deobfuscate a JS code
|
///Unpack a JS code
|
||||||
static const $Function evalJs = $Function(_evalJs);
|
static const $Function evalJs = $Function(_evalJs);
|
||||||
|
|
||||||
static $Value? _evalJs(_, __, List<$Value?> args) {
|
static $Value? _evalJs(_, __, List<$Value?> args) {
|
||||||
|
|
|
||||||
|
|
@ -27,17 +27,4 @@ class MManga {
|
||||||
this.status = Status.unknown,
|
this.status = Status.unknown,
|
||||||
this.description,
|
this.description,
|
||||||
this.chapters});
|
this.chapters});
|
||||||
|
|
||||||
// Manga toManga(Manga? manga, String source) {
|
|
||||||
// return Manga(
|
|
||||||
// source: manga?.source ?? source,
|
|
||||||
// author: author,
|
|
||||||
// genre: genre,
|
|
||||||
// imageUrl: imageUrl,
|
|
||||||
// lang: "lang",
|
|
||||||
// link: link,
|
|
||||||
// name: name,
|
|
||||||
// status: status!,
|
|
||||||
// description: description);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,18 @@ import 'package:mangayomi/models/source.dart';
|
||||||
//For testing purposes, set to true
|
//For testing purposes, set to true
|
||||||
const useTestSourceCode = false;
|
const useTestSourceCode = false;
|
||||||
|
|
||||||
final testSourceModelList = [Source(
|
final testSourceModelList = [
|
||||||
name: "Test Source",
|
Source(
|
||||||
// Example: https://gogoanime3.net
|
name: "Test Source",
|
||||||
baseUrl: "",
|
// Example: https://gogoanime3.net
|
||||||
// source code
|
baseUrl: "",
|
||||||
sourceCode: testSourceCode,
|
// source code
|
||||||
// Example: en
|
sourceCode: testSourceCode,
|
||||||
lang: "",
|
// Example: en
|
||||||
// Example: false for anime or true for manga
|
lang: "",
|
||||||
isManga: false)];
|
// Example: false for anime or true for manga
|
||||||
|
isManga: false)
|
||||||
|
];
|
||||||
|
|
||||||
const testSourceCode = r'''
|
const testSourceCode = r'''
|
||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
|
|
@ -42,13 +44,13 @@ class TestSource extends MProvider {
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
}
|
}
|
||||||
|
|
||||||
// For anime videos
|
// For anime episode video list
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
}
|
}
|
||||||
|
|
||||||
// For manga pages
|
// For manga chapter pages
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource source, String url) {
|
Future<List<String>> getPageList(MSource source, String url) {
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ import 'package:mangayomi/sources/source_test.dart';
|
||||||
|
|
||||||
Source? getSource(String lang, String name) {
|
Source? getSource(String lang, String name) {
|
||||||
if (testSourceModelList.isNotEmpty && useTestSourceCode) {
|
if (testSourceModelList.isNotEmpty && useTestSourceCode) {
|
||||||
|
if (lang.isEmpty || name.isEmpty) {
|
||||||
|
return testSourceModelList.first;
|
||||||
|
}
|
||||||
return testSourceModelList
|
return testSourceModelList
|
||||||
.firstWhere((element) => element.lang == lang && element.name == name);
|
.firstWhere((element) => element.lang == lang && element.name == name);
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +17,7 @@ Source? getSource(String lang, String name) {
|
||||||
(element) =>
|
(element) =>
|
||||||
element.name!.toLowerCase() == name.toLowerCase() &&
|
element.name!.toLowerCase() == name.toLowerCase() &&
|
||||||
element.lang == lang,
|
element.lang == lang,
|
||||||
orElse: () => throw (),
|
orElse: () => throw ("Error when getting source"),
|
||||||
);
|
);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue