mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-01-11 22:40:36 +00:00
remove unnecessary calls
.trimLeft().trimRight() after trim() is unnecessary.
This commit is contained in:
parent
a078b59678
commit
0f83899bac
6 changed files with 10 additions and 12 deletions
|
|
@ -75,14 +75,12 @@ class MBridge {
|
|||
var query = htmlXPath.query(xpath);
|
||||
if (query.nodes.length > 1) {
|
||||
for (var element in query.attrs) {
|
||||
attrs.add(element!.trim().trimLeft().trimRight());
|
||||
attrs.add(element!.trim());
|
||||
}
|
||||
}
|
||||
//Return one attr
|
||||
else if (query.nodes.length == 1) {
|
||||
String attr = query.attr != null
|
||||
? query.attr!.trim().trimLeft().trimRight()
|
||||
: "";
|
||||
String attr = query.attr != null ? query.attr!.trim() : "";
|
||||
if (attr.isNotEmpty) {
|
||||
attrs = [attr];
|
||||
}
|
||||
|
|
@ -102,7 +100,7 @@ class MBridge {
|
|||
statusMap = element;
|
||||
for (var element in statusMap.entries) {
|
||||
if (element.key.toString().toLowerCase().contains(
|
||||
status.toLowerCase().trim().trimLeft().trimRight(),
|
||||
status.toLowerCase().trim(),
|
||||
)) {
|
||||
return switch (element.value as int) {
|
||||
0 => Status.ongoing,
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ Future<void> downloadChapter(
|
|||
if (!file.existsSync()) {
|
||||
pages.add(
|
||||
PageUrl(
|
||||
page.url.trim().trimLeft().trimRight(),
|
||||
page.url.trim(),
|
||||
headers: pageHeaders,
|
||||
fileName: p.join(
|
||||
chapterDirectory.path,
|
||||
|
|
@ -325,7 +325,7 @@ Future<void> downloadChapter(
|
|||
if (!file.existsSync()) {
|
||||
pages.add(
|
||||
PageUrl(
|
||||
page.url.trim().trimLeft().trimRight(),
|
||||
page.url.trim(),
|
||||
headers: pageHeaders,
|
||||
fileName: p.join(mangaMainDirectory.path, "$chapterName.mp4"),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ Future<void> pushToMangaReaderDetail({
|
|||
mangaM ??
|
||||
Manga(
|
||||
imageUrl: getManga!.imageUrl,
|
||||
name: getManga.name!.trim().trimLeft().trimRight(),
|
||||
name: getManga.name!.trim(),
|
||||
genre: getManga.genre?.map((e) => e.toString()).toList() ?? [],
|
||||
author: getManga.author ?? "",
|
||||
status: getManga.status ?? Status.unknown,
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ extension DocumentExtension on Document? {
|
|||
var htmlXPath = HtmlXPath.node(dom);
|
||||
var query = htmlXPath.query(xpath);
|
||||
if (query.nodes.length > 1) {
|
||||
return query.attrs.map((e) => e!.trim().trimLeft().trimRight()).toList();
|
||||
return query.attrs.map((e) => e!.trim()).toList();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
|
@ -365,7 +365,7 @@ extension ElementtExtension on Element {
|
|||
var htmlXPath = HtmlXPath.node(this);
|
||||
var query = htmlXPath.query(xpath);
|
||||
if (query.nodes.length > 1) {
|
||||
return query.attrs.map((e) => e!.trim().trimLeft().trimRight()).toList();
|
||||
return query.attrs.map((e) => e!.trim()).toList();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ extension UChapDataPreloadExtensions on UChapDataPreload {
|
|||
),
|
||||
)
|
||||
: CustomExtendedNetworkImageProvider(
|
||||
data.pageUrl!.url.trim().trimLeft().trimRight(),
|
||||
data.pageUrl!.url.trim(),
|
||||
cache: true,
|
||||
cacheMaxAge: const Duration(days: 7),
|
||||
showCloudFlareError: showCloudFlareError,
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
// var query = xpath(expression);
|
||||
// if (query.isNotEmpty) {
|
||||
// return query
|
||||
// .map((e) => (e.value ?? "").trim().trimLeft().trimRight())
|
||||
// .map((e) => (e.value ?? "").trim())
|
||||
// .toList();
|
||||
// }
|
||||
// } catch (_) {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue