mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-15 11:21:11 +00:00
Fix sortVideos
This commit is contained in:
@@ -434,17 +434,18 @@ class ZoroTheme extends MProvider {
|
|||||||
String quality = getPreferenceValue(sourceId, "preferred_quality");
|
String quality = getPreferenceValue(sourceId, "preferred_quality");
|
||||||
String server = getPreferenceValue(sourceId, "preferred_server");
|
String server = getPreferenceValue(sourceId, "preferred_server");
|
||||||
String type = getPreferenceValue(sourceId, "preferred_type");
|
String type = getPreferenceValue(sourceId, "preferred_type");
|
||||||
videos = videos
|
|
||||||
.where(
|
|
||||||
(MVideo e) => e.quality.toLowerCase().contains(type.toLowerCase()))
|
|
||||||
.toList();
|
|
||||||
videos.sort((MVideo a, MVideo b) {
|
videos.sort((MVideo a, MVideo b) {
|
||||||
int qualityMatchA = 0;
|
int qualityMatchA = 0;
|
||||||
if (a.quality.contains(quality)) {
|
|
||||||
|
if (a.quality.contains(quality) &&
|
||||||
|
a.quality.toLowerCase().contains(type.toLowerCase()) &&
|
||||||
|
a.quality.toLowerCase().contains(server.toLowerCase())) {
|
||||||
qualityMatchA = 1;
|
qualityMatchA = 1;
|
||||||
}
|
}
|
||||||
int qualityMatchB = 0;
|
int qualityMatchB = 0;
|
||||||
if (b.quality.contains(quality)) {
|
if (b.quality.contains(quality) &&
|
||||||
|
b.quality.toLowerCase().contains(type.toLowerCase()) &&
|
||||||
|
b.quality.toLowerCase().contains(server.toLowerCase())) {
|
||||||
qualityMatchB = 1;
|
qualityMatchB = 1;
|
||||||
}
|
}
|
||||||
if (qualityMatchA != qualityMatchB) {
|
if (qualityMatchA != qualityMatchB) {
|
||||||
@@ -458,18 +459,6 @@ class ZoroTheme extends MProvider {
|
|||||||
final int qualityNumB = int.tryParse(matchB?.group(1) ?? '0') ?? 0;
|
final int qualityNumB = int.tryParse(matchB?.group(1) ?? '0') ?? 0;
|
||||||
return qualityNumB - qualityNumA;
|
return qualityNumB - qualityNumA;
|
||||||
});
|
});
|
||||||
|
|
||||||
videos.sort((MVideo a, MVideo b) {
|
|
||||||
int serverMatchA = 0;
|
|
||||||
if (a.quality.toLowerCase().contains(server.toLowerCase())) {
|
|
||||||
serverMatchA = 1;
|
|
||||||
}
|
|
||||||
int serverMatchB = 0;
|
|
||||||
if (b.quality.toLowerCase().contains(server.toLowerCase())) {
|
|
||||||
serverMatchB = 1;
|
|
||||||
}
|
|
||||||
return serverMatchB - serverMatchA;
|
|
||||||
});
|
|
||||||
return videos;
|
return videos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -655,17 +655,18 @@ class Aniwave extends MProvider {
|
|||||||
String quality = getPreferenceValue(sourceId, "preferred_quality");
|
String quality = getPreferenceValue(sourceId, "preferred_quality");
|
||||||
String server = getPreferenceValue(sourceId, "preferred_server");
|
String server = getPreferenceValue(sourceId, "preferred_server");
|
||||||
String lang = getPreferenceValue(sourceId, "preferred_language");
|
String lang = getPreferenceValue(sourceId, "preferred_language");
|
||||||
videos = videos
|
|
||||||
.where(
|
|
||||||
(MVideo e) => e.quality.toLowerCase().contains(lang.toLowerCase()))
|
|
||||||
.toList();
|
|
||||||
videos.sort((MVideo a, MVideo b) {
|
videos.sort((MVideo a, MVideo b) {
|
||||||
int qualityMatchA = 0;
|
int qualityMatchA = 0;
|
||||||
if (a.quality.contains(quality)) {
|
|
||||||
|
if (a.quality.contains(quality) &&
|
||||||
|
a.quality.toLowerCase().contains(lang.toLowerCase()) &&
|
||||||
|
a.quality.toLowerCase().contains(server.toLowerCase())) {
|
||||||
qualityMatchA = 1;
|
qualityMatchA = 1;
|
||||||
}
|
}
|
||||||
int qualityMatchB = 0;
|
int qualityMatchB = 0;
|
||||||
if (b.quality.contains(quality)) {
|
if (b.quality.contains(quality) &&
|
||||||
|
b.quality.toLowerCase().contains(lang.toLowerCase()) &&
|
||||||
|
b.quality.toLowerCase().contains(server.toLowerCase())) {
|
||||||
qualityMatchB = 1;
|
qualityMatchB = 1;
|
||||||
}
|
}
|
||||||
if (qualityMatchA != qualityMatchB) {
|
if (qualityMatchA != qualityMatchB) {
|
||||||
@@ -680,17 +681,6 @@ class Aniwave extends MProvider {
|
|||||||
return qualityNumB - qualityNumA;
|
return qualityNumB - qualityNumA;
|
||||||
});
|
});
|
||||||
|
|
||||||
videos.sort((MVideo a, MVideo b) {
|
|
||||||
int serverMatchA = 0;
|
|
||||||
if (a.quality.toLowerCase().contains(server.toLowerCase())) {
|
|
||||||
serverMatchA = 1;
|
|
||||||
}
|
|
||||||
int serverMatchB = 0;
|
|
||||||
if (b.quality.toLowerCase().contains(server.toLowerCase())) {
|
|
||||||
serverMatchB = 1;
|
|
||||||
}
|
|
||||||
return serverMatchB - serverMatchA;
|
|
||||||
});
|
|
||||||
return videos;
|
return videos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1117,11 +1117,11 @@ class GogoAnime extends MProvider {
|
|||||||
|
|
||||||
videos.sort((MVideo a, MVideo b) {
|
videos.sort((MVideo a, MVideo b) {
|
||||||
int qualityMatchA = 0;
|
int qualityMatchA = 0;
|
||||||
if (a.quality.contains(quality)) {
|
if (a.quality.contains(quality) && a.quality.contains(server)) {
|
||||||
qualityMatchA = 1;
|
qualityMatchA = 1;
|
||||||
}
|
}
|
||||||
int qualityMatchB = 0;
|
int qualityMatchB = 0;
|
||||||
if (b.quality.contains(quality)) {
|
if (b.quality.contains(quality) && b.quality.contains(server)) {
|
||||||
qualityMatchB = 1;
|
qualityMatchB = 1;
|
||||||
}
|
}
|
||||||
if (qualityMatchA != qualityMatchB) {
|
if (qualityMatchA != qualityMatchB) {
|
||||||
@@ -1136,17 +1136,6 @@ class GogoAnime extends MProvider {
|
|||||||
return qualityNumB - qualityNumA;
|
return qualityNumB - qualityNumA;
|
||||||
});
|
});
|
||||||
|
|
||||||
videos.sort((MVideo a, MVideo b) {
|
|
||||||
int serverMatchA = 0;
|
|
||||||
if (a.quality.contains(server)) {
|
|
||||||
serverMatchA = 1;
|
|
||||||
}
|
|
||||||
int serverMatchB = 0;
|
|
||||||
if (b.quality.contains(server)) {
|
|
||||||
serverMatchB = 1;
|
|
||||||
}
|
|
||||||
return serverMatchB - serverMatchA;
|
|
||||||
});
|
|
||||||
return videos;
|
return videos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -360,17 +360,18 @@ class NineAnimeTv extends MProvider {
|
|||||||
String quality = getPreferenceValue(sourceId, "preferred_quality");
|
String quality = getPreferenceValue(sourceId, "preferred_quality");
|
||||||
String server = getPreferenceValue(sourceId, "preferred_server");
|
String server = getPreferenceValue(sourceId, "preferred_server");
|
||||||
String type = getPreferenceValue(sourceId, "preferred_type");
|
String type = getPreferenceValue(sourceId, "preferred_type");
|
||||||
videos = videos
|
|
||||||
.where(
|
|
||||||
(MVideo e) => e.quality.toLowerCase().contains(type.toLowerCase()))
|
|
||||||
.toList();
|
|
||||||
videos.sort((MVideo a, MVideo b) {
|
videos.sort((MVideo a, MVideo b) {
|
||||||
int qualityMatchA = 0;
|
int qualityMatchA = 0;
|
||||||
if (a.quality.contains(quality)) {
|
|
||||||
|
if (a.quality.contains(quality) &&
|
||||||
|
a.quality.toLowerCase().contains(type.toLowerCase()) &&
|
||||||
|
a.quality.toLowerCase().contains(server.toLowerCase())) {
|
||||||
qualityMatchA = 1;
|
qualityMatchA = 1;
|
||||||
}
|
}
|
||||||
int qualityMatchB = 0;
|
int qualityMatchB = 0;
|
||||||
if (b.quality.contains(quality)) {
|
if (b.quality.contains(quality) &&
|
||||||
|
b.quality.toLowerCase().contains(type.toLowerCase()) &&
|
||||||
|
b.quality.toLowerCase().contains(server.toLowerCase())) {
|
||||||
qualityMatchB = 1;
|
qualityMatchB = 1;
|
||||||
}
|
}
|
||||||
if (qualityMatchA != qualityMatchB) {
|
if (qualityMatchA != qualityMatchB) {
|
||||||
@@ -384,18 +385,6 @@ class NineAnimeTv extends MProvider {
|
|||||||
final int qualityNumB = int.tryParse(matchB?.group(1) ?? '0') ?? 0;
|
final int qualityNumB = int.tryParse(matchB?.group(1) ?? '0') ?? 0;
|
||||||
return qualityNumB - qualityNumA;
|
return qualityNumB - qualityNumA;
|
||||||
});
|
});
|
||||||
|
|
||||||
videos.sort((MVideo a, MVideo b) {
|
|
||||||
int serverMatchA = 0;
|
|
||||||
if (a.quality.toLowerCase().contains(server.toLowerCase())) {
|
|
||||||
serverMatchA = 1;
|
|
||||||
}
|
|
||||||
int serverMatchB = 0;
|
|
||||||
if (b.quality.toLowerCase().contains(server.toLowerCase())) {
|
|
||||||
serverMatchB = 1;
|
|
||||||
}
|
|
||||||
return serverMatchB - serverMatchA;
|
|
||||||
});
|
|
||||||
return videos;
|
return videos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user