netflixmirror: include conditional media name display based on user preference

This commit is contained in:
Moustapha Kodjo Amadou
2025-01-21 09:04:17 +01:00
parent 131600dbef
commit 90433819e4

View File

@@ -7,7 +7,7 @@ const mangayomiSources = [{
"iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/all.netflixmirror.png", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/all.netflixmirror.png",
"typeSource": "single", "typeSource": "single",
"itemType": 1, "itemType": 1,
"version": "0.1.2", "version": "0.1.3",
"pkgPath": "anime/src/all/netflixmirror.js" "pkgPath": "anime/src/all/netflixmirror.js"
}]; }];
@@ -110,6 +110,7 @@ class DefaultExtension extends MProvider {
async getDetail(url) { async getDetail(url) {
var service = this.getServiceDetails(); var service = this.getServiceDetails();
const cookie = await this.getCookie(); const cookie = await this.getCookie();
var name_pref = this.getPreference("netmirror_pref_display_name_1");
const data = JSON.parse(await this.request(`/post.php?id=${url}`, cookie)); const data = JSON.parse(await this.request(`/post.php?id=${url}`, cookie));
const name = data.title; const name = data.title;
const genre = [data.ua, ...(data.genre || '').split(',').map(g => g.trim())]; const genre = [data.ua, ...(data.genre || '').split(',').map(g => g.trim())];
@@ -144,7 +145,7 @@ class DefaultExtension extends MProvider {
if (service === "pv") link = `https://www.primevideo.com/detail/${url}` if (service === "pv") link = `https://www.primevideo.com/detail/${url}`
return { return {
name, imageUrl: this.getPoster(url, service), link, description, status: 1, genre, episodes name: name_pref ? name : null, imageUrl: this.getPoster(url, service), link, description, status: 1, genre, episodes
}; };
} }
async getEpisodes(name, eid, sid, page, cookie) { async getEpisodes(name, eid, sid, page, cookie) {