add 'all' to provider preference

This commit is contained in:
Moustapha Kodjo Amadou
2025-01-16 10:58:12 +01:00
parent 3f074ce534
commit b88f5d7498

View File

@@ -6,7 +6,7 @@ const mangayomiSources = [{
"iconUrl": "https://www.google.com/s2/favicons?sz=128&domain=https://aniplaynow.live/", "iconUrl": "https://www.google.com/s2/favicons?sz=128&domain=https://aniplaynow.live/",
"typeSource": "single", "typeSource": "single",
"itemType": 1, "itemType": 1,
"version": "1.0.0", "version": "1.0.1",
"dateFormat": "", "dateFormat": "",
"dateFormatLocale": "", "dateFormatLocale": "",
"pkgPath": "anime/src/en/aniplay.js" "pkgPath": "anime/src/en/aniplay.js"
@@ -322,14 +322,18 @@ class DefaultExtension extends MProvider {
throw new Error("Error: No data found for the given URL"); throw new Error("Error: No data found for the given URL");
} }
var user_provider = this.getPreference("aniplay_pref_provider"); var user_provider = this.getPreference("aniplay_pref_provider_new");
var choice = result[0] var choices = result
if (user_provider !== "all") {
for (var ch of result) { for (var ch of result) {
if (ch["providerId"] == user_provider) { if (ch["providerId"] == user_provider) {
choice = ch choices = [ch]
break; break;
} }
} }
}
for (const choice of choices) {
var user_mark_filler_ep = this.getPreference("aniplay_pref_mark_filler"); var user_mark_filler_ep = this.getPreference("aniplay_pref_mark_filler");
var chapters = [] var chapters = []
var epList = choice.episodes var epList = choice.episodes
@@ -349,6 +353,8 @@ class DefaultExtension extends MProvider {
var epUrl = `${anilistId}||${JSON.stringify(ep)}||${choice.providerId}` var epUrl = `${anilistId}||${JSON.stringify(ep)}||${choice.providerId}`
chapters.push({ name, url: epUrl, dateUpload }) chapters.push({ name, url: epUrl, dateUpload })
} }
}
var format = animeData.format var format = animeData.format
if (format === "MOVIE") chapters[0].name = "Movie" if (format === "MOVIE") chapters[0].name = "Movie"
@@ -462,13 +468,7 @@ class DefaultExtension extends MProvider {
return await this.sortStreams(streams) return await this.sortStreams(streams)
} }
// For manga chapter pages
async getPageList() {
throw new Error("getPageList not implemented");
}
getFilterList() {
throw new Error("getFilterList not implemented");
}
getSourcePreferences() { getSourcePreferences() {
return [ return [
{ {
@@ -482,13 +482,13 @@ class DefaultExtension extends MProvider {
} }
}, },
{ {
"key": "aniplay_pref_provider", "key": "aniplay_pref_provider_new",
"listPreference": { "listPreference": {
"title": "Preferred provider", "title": "Preferred provider",
"summary": "", "summary": "",
"valueIndex": 0, "valueIndex": 0,
"entries": ["Anya", "Yuki"], "entries": ["All", "Anya", "Yuki"],
"entryValues": ["anya", "yuki"], "entryValues": ["all", "anya", "yuki"],
} }
}, { }, {
"key": "aniplay_pref_mark_filler", "key": "aniplay_pref_mark_filler",