New source (multi Batoto), some code refactor

This commit is contained in:
kodjomoustapha
2023-09-11 10:41:53 +01:00
parent 899ee3065a
commit 15385b40c5
7 changed files with 476 additions and 417 deletions

View File

@@ -8,210 +8,67 @@ const mangadexVersion = "0.0.13";
const mangadexSourceCodeUrl =
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/src/all/mangadex/mangadex-v$mangadexVersion.dart";
String _iconUrl = getIconUrl("mangadex", "all");
List<Source> get mangaDexSourcesList => _mangaDexSourcesList;
List<Source> _mangaDexSourcesList = [
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'en',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'ar',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'pt',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'pt-br',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'it',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'ru',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'es',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'es-419',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'id',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'hi',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'de',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'ja',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'tr',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'pl',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'zh',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'zh-hk',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: 'fr',
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl),
final languages = [
"ar",
"bn",
"bg",
"my",
"ca",
"zh",
"zh-hk",
"cs",
"da",
"nl",
"en",
"tl",
"fi",
"fr",
"de",
"el",
"he",
"hi",
"hu",
"id",
"it",
"ja",
"kk",
"ko",
"la",
"lt",
"ms",
"mn",
"ne",
"no",
"fa",
"pl",
"pt-br",
"pt",
"ro",
"ru",
"sh",
"es-419",
"es",
"sv",
"ta",
"th",
"tr",
"uk",
"vi"
];
List<Source> get mangaDexSourcesList => _mangaDexSourcesList;
List<Source> _mangaDexSourcesList = languages
.map((e) => Source(
name: 'MangaDex',
apiUrl: apiUrl,
baseUrl: baseUrl,
lang: e,
typeSource: "mangadex",
iconUrl: _iconUrl,
dateFormat: "yyyy-MM-dd'T'HH:mm:ss+SSS",
isNsfw: isNsfw,
dateFormatLocale: 'en_Us',
version: mangadexVersion,
sourceCodeUrl: mangadexSourceCodeUrl))
.toList();