修复排行榜

This commit is contained in:
lzyme.dev@gmail.com
2026-10-12 01:30:17 +08:00
parent 9d322cc76d
commit 171ee3b9d7
6 changed files with 67 additions and 41 deletions
+31 -26
View File
@@ -2879,10 +2879,7 @@ ${value}\r
carNum2 = dateElements.find(((i) => !isDate(i))) || null; carNum2 = dateElements.find(((i) => !isDate(i))) || null;
} }
if (!carNum2) { if (!carNum2) {
const msg = "提取番号信息失败: carNum 为空"; return null;
console.error("Error in getBoxCarInfo:", msg, "Box Element:", $box2.get(0));
show.error(msg);
throw new Error(msg);
} }
return { return {
carNum: carNum2, carNum: carNum2,
@@ -3435,7 +3432,7 @@ ${value}\r
async shouldDisablePaging() { async shouldDisablePaging() {
if (!window.isListPage) return true; if (!window.isListPage) return true;
await storageManager.getSetting("autoPage", YES$1); await storageManager.getSetting("autoPage", YES$1);
return ["search?q", "handlePlayback=1", "handleTop=1", "/want_watch_videos", "/watched_videos", "/advanced_search?type=100"].some(((path) => currentHref$1.includes(path))); return ["search?q", "/rankings/playback", "/rankings/top", "/want_watch_videos", "/watched_videos", "/advanced_search?type=100"].some(((path) => currentHref$1.includes(path)));
} }
updatePageUrl_old(href) { updatePageUrl_old(href) {
window.history.pushState({}, "", href); window.history.pushState({}, "", href);
@@ -9488,7 +9485,7 @@ ${value}\r
$('a[href*="rankings/playback"]').on("click", ((event) => { $('a[href*="rankings/playback"]').on("click", ((event) => {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
window.location.href = "/advanced_search?handlePlayback=1&period=daily"; window.location.href = "/rankings/playback";
})); }));
this.handlePlayback().then(); this.handlePlayback().then();
} }
@@ -9503,7 +9500,7 @@ ${value}\r
this.$contentBox.append('<div class="movie-list h cols-4 vcols-8" style="margin-top: 10px"></div>'); this.$contentBox.append('<div class="movie-list h cols-4 vcols-8" style="margin-top: 10px"></div>');
} }
async handlePlayback() { async handlePlayback() {
if (!window.location.href.includes("handlePlayback=1")) return; if (!window.location.href.includes("rankings/playback")) return;
let period = new URLSearchParams(window.location.search).get("period"); let period = new URLSearchParams(window.location.search).get("period");
this.toolBar(period); this.toolBar(period);
this.hookPage(); this.hookPage();
@@ -9514,6 +9511,7 @@ ${value}\r
const movies = await javDbApi.playback(period); const movies = await javDbApi.playback(period);
let moviesHtml = javDbApi.markDataListHtml(movies); let moviesHtml = javDbApi.markDataListHtml(movies);
$movieBox.html(moviesHtml); $movieBox.html(moviesHtml);
this.pluginManager.getBean("ListPagePlugin").doFilter();
} catch (e) { } catch (e) {
clog.error("发生错误:", e); clog.error("发生错误:", e);
} finally { } finally {
@@ -9524,9 +9522,9 @@ ${value}\r
let conditionHtml = ` let conditionHtml = `
<div class="button-group" style="margin-top:18px"> <div class="button-group" style="margin-top:18px">
<div class="buttons has-addons" id="conditionBox"> <div class="buttons has-addons" id="conditionBox">
<a style="padding:18px 18px !important;" class="button is-small ${"daily" === period ? "is-info" : ""}" href="/advanced_search?handlePlayback=1&period=daily">日榜</a> <a style="padding:18px 18px !important;" class="button is-small ${"daily" === period ? "is-info" : ""}" href="/rankings/playback?period=daily">日榜</a>
<a style="padding:18px 18px !important;" class="button is-small ${"weekly" === period ? "is-info" : ""}" href="/advanced_search?handlePlayback=1&period=weekly">周榜</a> <a style="padding:18px 18px !important;" class="button is-small ${"weekly" === period ? "is-info" : ""}" href="/rankings/playback?period=weekly">周榜</a>
<a style="padding:18px 18px !important;" class="button is-small ${"monthly" === period ? "is-info" : ""}" href="/advanced_search?handlePlayback=1&period=monthly">月榜</a> <a style="padding:18px 18px !important;" class="button is-small ${"monthly" === period ? "is-info" : ""}" href="/rankings/playback?period=monthly">月榜</a>
</div> </div>
</div> </div>
`; `;
@@ -9641,9 +9639,16 @@ ${err.stack}` : "");
})); }));
} }
async handleTop() { async handleTop() {
if (!window.location.href.includes("handleTop=1")) return; if (!window.location.href.includes("/rankings/top")) return;
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
let type = urlParams.get("handleType") || "all", type_value = urlParams.get("type_value") || ""; let t = urlParams.get("t") || "", type = "all", type_value = "";
if (/^y\d+$/.test(t)) {
type = "year";
type_value = t.substring(1);
} else if ("" !== t) {
type = "video_type";
type_value = t;
}
this.has_cnsub = urlParams.get("has_cnsub") || ""; this.has_cnsub = urlParams.get("has_cnsub") || "";
let page = urlParams.get("page") || 1; let page = urlParams.get("page") || 1;
this.toolBar(type, type_value, page); this.toolBar(type, type_value, page);
@@ -9665,6 +9670,7 @@ ${err.stack}` : "");
const filter_movies = dataList.filter(((item) => "1" === this.has_cnsub ? item.has_cnsub : "0" !== this.has_cnsub || !item.has_cnsub)); const filter_movies = dataList.filter(((item) => "1" === this.has_cnsub ? item.has_cnsub : "0" !== this.has_cnsub || !item.has_cnsub));
let moviesHtml = javDbApi.markDataListHtml(filter_movies); let moviesHtml = javDbApi.markDataListHtml(filter_movies);
$movieBox.html(moviesHtml); $movieBox.html(moviesHtml);
this.pluginManager.getBean("ListPagePlugin").doFilter();
} else { } else {
clog.error(res); clog.error(res);
$movieBox.html(`<h3>${message}</h3>`); $movieBox.html(`<h3>${message}</h3>`);
@@ -9690,18 +9696,18 @@ ${err.stack}` : "");
for (let year = (/* @__PURE__ */ new Date()).getFullYear(); year >= 2008; year--) yearHtml += ` for (let year = (/* @__PURE__ */ new Date()).getFullYear(); year >= 2008; year--) yearHtml += `
<a style="padding:18px 18px !important;" <a style="padding:18px 18px !important;"
class="button is-small ${type_value === year.toString() ? "is-info" : ""}" class="button is-small ${type_value === year.toString() ? "is-info" : ""}"
href="/advanced_search?handleTop=1&handleType=year&type_value=${year}&has_cnsub=${this.has_cnsub}"> href="/rankings/top?t=y${year}&has_cnsub=${this.has_cnsub}">
${year} ${year}
</a> </a>
`; `;
let conditionHtml = ` let conditionHtml = `
<div class="button-group"> <div class="button-group">
<div class="buttons has-addons" id="conditionBox" style="margin-bottom: 0!important;"> <div class="buttons has-addons" id="conditionBox" style="margin-bottom: 0!important;">
<a style="padding:18px 18px !important;" class="button is-small ${"all" === type ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=all&type_value=&has_cnsub=${this.has_cnsub}">全部</a> <a style="padding:18px 18px !important;" class="button is-small ${"all" === type ? "is-info" : ""}" href="/rankings/top?has_cnsub=${this.has_cnsub}">全部</a>
<a style="padding:18px 18px !important;" class="button is-small ${"0" === type_value ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=0&has_cnsub=${this.has_cnsub}">有码</a> <a style="padding:18px 18px !important;" class="button is-small ${"0" === type_value ? "is-info" : ""}" href="/rankings/top?t=0&has_cnsub=${this.has_cnsub}">有码</a>
<a style="padding:18px 18px !important;" class="button is-small ${"1" === type_value ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=1&has_cnsub=${this.has_cnsub}">无码</a> <a style="padding:18px 18px !important;" class="button is-small ${"1" === type_value ? "is-info" : ""}" href="/rankings/top?t=1&has_cnsub=${this.has_cnsub}">无码</a>
<a style="padding:18px 18px !important;" class="button is-small ${"2" === type_value ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=2&has_cnsub=${this.has_cnsub}">欧美</a> <a style="padding:18px 18px !important;" class="button is-small ${"2" === type_value ? "is-info" : ""}" href="/rankings/top?t=2&has_cnsub=${this.has_cnsub}">欧美</a>
<a style="padding:18px 18px !important;" class="button is-small ${"3" === type_value ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=3&has_cnsub=${this.has_cnsub}">Fc2</a> <a style="padding:18px 18px !important;" class="button is-small ${"3" === type_value ? "is-info" : ""}" href="/rankings/top?t=3&has_cnsub=${this.has_cnsub}">Fc2</a>
<a style="padding:18px 18px !important;margin-left: 50px" class="button is-small ${"1" === this.has_cnsub ? "is-info" : ""}" data-cnsub-value="1">含中字磁鏈</a> <a style="padding:18px 18px !important;margin-left: 50px" class="button is-small ${"1" === this.has_cnsub ? "is-info" : ""}" data-cnsub-value="1">含中字磁鏈</a>
<a style="padding:18px 18px !important;" class="button is-small ${"0" === this.has_cnsub ? "is-info" : ""}" data-cnsub-value="0">无字幕</a> <a style="padding:18px 18px !important;" class="button is-small ${"0" === this.has_cnsub ? "is-info" : ""}" data-cnsub-value="0">无字幕</a>
@@ -9743,7 +9749,8 @@ ${err.stack}` : "");
type = "video_type"; type = "video_type";
type_value = t; type_value = t;
} }
let url = `/advanced_search?handleTop=1&handleType=${type}&type_value=${type_value}`; let tParam = "year" === type ? `y${type_value}` : "all" === type ? "" : type_value;
let url = `/rankings/top${tParam ? `?t=${tParam}` : ""}`;
event && (event.ctrlKey || event.metaKey) ? _GM_openInTab(window.location.origin + url, { event && (event.ctrlKey || event.metaKey) ? _GM_openInTab(window.location.origin + url, {
insert: 0 insert: 0
}) : window.location.href = url; }) : window.location.href = url;
@@ -9808,7 +9815,7 @@ ${err.stack}` : "");
await localStorage.setItem("jhs_appAuthorization", token); await localStorage.setItem("jhs_appAuthorization", token);
show.ok("登录成功"); show.ok("登录成功");
layer.close(index); layer.close(index);
window.location.href = "/advanced_search?handleTop=1&period=daily"; window.location.href = "/rankings/top";
} }
} }
})).catch(((err) => { })).catch(((err) => {
@@ -17098,12 +17105,10 @@ ${err.stack}` : "");
await Promise.all(movieList.map((async (ele) => { await Promise.all(movieList.map((async (ele) => {
let $box2 = $(ele); let $box2 = $(ele);
if (isJavBus$1 && $box2.find(".avatar-box").length > 0) return; if (isJavBus$1 && $box2.find(".avatar-box").length > 0) return;
const {carNum: carNum2, title} = this.getBoxCarInfo($box2), { const boxInfo = this.getBoxCarInfo($box2);
filter, if (!boxInfo) return;
favorite, const {carNum: carNum2, title} = boxInfo, {filter, favorite, hasDown, hasWatch} = carNumSets,
hasDown, isFavorite = favorite.has(carNum2), isHasDown = hasDown.has(carNum2),
hasWatch
} = carNumSets, isFavorite = favorite.has(carNum2), isHasDown = hasDown.has(carNum2),
isHasWatch = hasWatch.has(carNum2), isFiltered = filter.has(carNum2), isHasWatch = hasWatch.has(carNum2), isFiltered = filter.has(carNum2),
isFilterActorMale = actorCarNumToNameMap.has(carNum2), isFilterActorMale = actorCarNumToNameMap.has(carNum2),
isFilterActorFemale = actressCarNumToNameMap.has(carNum2), isFilterActorFemale = actressCarNumToNameMap.has(carNum2),
+1 -4
View File
@@ -145,10 +145,7 @@ class BasePlugin {
carNum2 = dateElements.find((i => !isDate(i))) || null; carNum2 = dateElements.find((i => !isDate(i))) || null;
} }
if (!carNum2) { if (!carNum2) {
const msg = "提取番号信息失败: carNum 为空"; return null;
console.error("Error in getBoxCarInfo:", msg, "Box Element:", $box2.get(0));
show.error(msg);
throw new Error(msg);
} }
return { return {
carNum: carNum2, carNum: carNum2,
+1 -1
View File
@@ -152,7 +152,7 @@ class AutoPagePlugin extends BasePlugin {
async shouldDisablePaging() { async shouldDisablePaging() {
if (!window.isListPage) return !0; if (!window.isListPage) return !0;
await storageManager.getSetting("autoPage", YES); await storageManager.getSetting("autoPage", YES);
return [ "search?q", "handlePlayback=1", "handleTop=1", "/want_watch_videos", "/watched_videos", "/advanced_search?type=100" ].some((path => currentHref.includes(path))); return ["search?q", "/rankings/playback", "/rankings/top", "/want_watch_videos", "/watched_videos", "/advanced_search?type=100"].some((path => currentHref.includes(path)));
} }
updatePageUrl_old(href) { updatePageUrl_old(href) {
window.history.pushState({}, "", href); window.history.pushState({}, "", href);
+4 -3
View File
@@ -14,7 +14,7 @@ class HitShowPlugin extends BasePlugin {
$('a[href*="rankings/playback"]').on("click", (event => { $('a[href*="rankings/playback"]').on("click", (event => {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
window.location.href = "/advanced_search?handlePlayback=1&period=daily"; window.location.href = "/rankings/playback";
})); }));
this.handlePlayback().then(); this.handlePlayback().then();
} }
@@ -29,7 +29,7 @@ class HitShowPlugin extends BasePlugin {
this.$contentBox.append('<div class="movie-list h cols-4 vcols-8" style="margin-top: 10px"></div>'); this.$contentBox.append('<div class="movie-list h cols-4 vcols-8" style="margin-top: 10px"></div>');
} }
async handlePlayback() { async handlePlayback() {
if (!window.location.href.includes("handlePlayback=1")) return; if (!window.location.href.includes("rankings/playback")) return;
let period = new URLSearchParams(window.location.search).get("period"); let period = new URLSearchParams(window.location.search).get("period");
this.toolBar(period); this.toolBar(period);
this.hookPage(); this.hookPage();
@@ -40,6 +40,7 @@ class HitShowPlugin extends BasePlugin {
const movies = await javDbApi.playback(period); const movies = await javDbApi.playback(period);
let moviesHtml = javDbApi.markDataListHtml(movies); let moviesHtml = javDbApi.markDataListHtml(movies);
$movieBox.html(moviesHtml); $movieBox.html(moviesHtml);
this.pluginManager.getBean("ListPagePlugin").doFilter();
} catch (e) { } catch (e) {
clog.error("发生错误:", e); clog.error("发生错误:", e);
} finally { } finally {
@@ -47,7 +48,7 @@ class HitShowPlugin extends BasePlugin {
} }
} }
toolBar(period) { toolBar(period) {
let conditionHtml = `\n <div class="button-group" style="margin-top:18px">\n <div class="buttons has-addons" id="conditionBox">\n <a style="padding:18px 18px !important;" class="button is-small ${"daily" === period ? "is-info" : ""}" href="/advanced_search?handlePlayback=1&period=daily">日榜</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"weekly" === period ? "is-info" : ""}" href="/advanced_search?handlePlayback=1&period=weekly">周榜</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"monthly" === period ? "is-info" : ""}" href="/advanced_search?handlePlayback=1&period=monthly">月榜</a>\n </div>\n </div>\n `; let conditionHtml = `\n <div class="button-group" style="margin-top:18px">\n <div class="buttons has-addons" id="conditionBox">\n <a style="padding:18px 18px !important;" class="button is-small ${"daily" === period ? "is-info" : ""}" href="/rankings/playback?period=daily">日榜</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"weekly" === period ? "is-info" : ""}" href="/rankings/playback?period=weekly">周榜</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"monthly" === period ? "is-info" : ""}" href="/rankings/playback?period=monthly">月榜</a>\n </div>\n </div>\n `;
this.$contentBox.append(conditionHtml); this.$contentBox.append(conditionHtml);
} }
getStarRating(score) { getStarRating(score) {
+14 -1
View File
@@ -151,7 +151,20 @@ class ListPagePlugin extends BasePlugin {
await Promise.all(movieList.map((async ele => { await Promise.all(movieList.map((async ele => {
let $box2 = $(ele); let $box2 = $(ele);
if (isJavBus && $box2.find(".avatar-box").length > 0) return; if (isJavBus && $box2.find(".avatar-box").length > 0) return;
const {carNum: carNum2, title: title} = this.getBoxCarInfo($box2), {filter: filter, favorite: favorite, hasDown: hasDown, hasWatch: hasWatch} = carNumSets, isFavorite = favorite.has(carNum2), isHasDown = hasDown.has(carNum2), isHasWatch = hasWatch.has(carNum2), isFiltered = filter.has(carNum2), isFilterActorMale = actorCarNumToNameMap.has(carNum2), isFilterActorFemale = actressCarNumToNameMap.has(carNum2), isFilterActor = isFilterActorMale || isFilterActorFemale, foundKeyword = filterKeywordList.find((kw => title.includes(kw) || carNum2.startsWith(kw))), isFilterKeyword = !!foundKeyword; const boxInfo = this.getBoxCarInfo($box2);
if (!boxInfo) return;
const {carNum: carNum2, title: title} = boxInfo, {
filter: filter,
favorite: favorite,
hasDown: hasDown,
hasWatch: hasWatch
} = carNumSets, isFavorite = favorite.has(carNum2), isHasDown = hasDown.has(carNum2),
isHasWatch = hasWatch.has(carNum2), isFiltered = filter.has(carNum2),
isFilterActorMale = actorCarNumToNameMap.has(carNum2),
isFilterActorFemale = actressCarNumToNameMap.has(carNum2),
isFilterActor = isFilterActorMale || isFilterActorFemale,
foundKeyword = filterKeywordList.find((kw => title.includes(kw) || carNum2.startsWith(kw))),
isFilterKeyword = !!foundKeyword;
if (!isSearchPage) { if (!isSearchPage) {
let shouldHide = settings.showFavoriteItem === NO && isFavorite || settings.showHasDownItem === NO && isHasDown || settings.showHasWatchItem === NO && isHasWatch || settings.showFilterItem === NO && isFiltered && !(isFavorite || isHasDown || isHasWatch) || settings.showFilterActorItem === NO && isFilterActor || settings.showFilterKeywordItem === NO && isFilterKeyword; let shouldHide = settings.showFavoriteItem === NO && isFavorite || settings.showHasDownItem === NO && isHasDown || settings.showHasWatchItem === NO && isHasWatch || settings.showFilterItem === NO && isFiltered && !(isFavorite || isHasDown || isHasWatch) || settings.showFilterActorItem === NO && isFilterActor || settings.showFilterKeywordItem === NO && isFilterKeyword;
if ($box2.attr("data-movieShowType") !== settings.movieShowType) { if ($box2.attr("data-movieShowType") !== settings.movieShowType) {
+16 -6
View File
@@ -56,9 +56,16 @@ class TOP250Plugin extends BasePlugin {
})); }));
} }
async handleTop() { async handleTop() {
if (!window.location.href.includes("handleTop=1")) return; if (!window.location.href.includes("/rankings/top")) return;
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
let type = urlParams.get("handleType") || "all", type_value = urlParams.get("type_value") || ""; let t = urlParams.get("t") || "", type = "all", type_value = "";
if (/^y\d+$/.test(t)) {
type = "year";
type_value = t.substring(1);
} else if ("" !== t) {
type = "video_type";
type_value = t;
}
this.has_cnsub = urlParams.get("has_cnsub") || ""; this.has_cnsub = urlParams.get("has_cnsub") || "";
let page = urlParams.get("page") || 1; let page = urlParams.get("page") || 1;
this.toolBar(type, type_value, page); this.toolBar(type, type_value, page);
@@ -80,6 +87,7 @@ class TOP250Plugin extends BasePlugin {
const filter_movies = dataList.filter((item => "1" === this.has_cnsub ? item.has_cnsub : "0" !== this.has_cnsub || !item.has_cnsub)); const filter_movies = dataList.filter((item => "1" === this.has_cnsub ? item.has_cnsub : "0" !== this.has_cnsub || !item.has_cnsub));
let moviesHtml = javDbApi.markDataListHtml(filter_movies); let moviesHtml = javDbApi.markDataListHtml(filter_movies);
$movieBox.html(moviesHtml); $movieBox.html(moviesHtml);
this.pluginManager.getBean("ListPagePlugin").doFilter();
} else { } else {
clog.error(res); clog.error(res);
$movieBox.html(`<h3>${message}</h3>`); $movieBox.html(`<h3>${message}</h3>`);
@@ -101,9 +109,10 @@ class TOP250Plugin extends BasePlugin {
$(".pagination-list li a").each((function() { $(".pagination-list li a").each((function() {
parseInt($(this).text()) > 5 && $(this).closest("li").remove(); parseInt($(this).text()) > 5 && $(this).closest("li").remove();
})); }));
const currentTParam = "all" === type ? "" : "year" === type ? `y${type_value}` : type_value;
let yearHtml = ""; let yearHtml = "";
for (let year = (new Date).getFullYear(); year >= 2008; year--) yearHtml += `\n <a style="padding:18px 18px !important;" \n class="button is-small ${type_value === year.toString() ? "is-info" : ""}" \n href="/advanced_search?handleTop=1&handleType=year&type_value=${year}&has_cnsub=${this.has_cnsub}">\n ${year}\n </a>\n `; for (let year = (new Date).getFullYear(); year >= 2008; year--) yearHtml += `\n <a style="padding:18px 18px !important;" \n class="button is-small ${type_value === year.toString() ? "is-info" : ""}" \n href="/rankings/top?t=y${year}&has_cnsub=${this.has_cnsub}">\n ${year}\n </a>\n `;
let conditionHtml = `\n <div class="button-group">\n <div class="buttons has-addons" id="conditionBox" style="margin-bottom: 0!important;">\n <a style="padding:18px 18px !important;" class="button is-small ${"all" === type ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=all&type_value=&has_cnsub=${this.has_cnsub}">全部</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"0" === type_value ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=0&has_cnsub=${this.has_cnsub}">有码</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"1" === type_value ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=1&has_cnsub=${this.has_cnsub}">无码</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"2" === type_value ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=2&has_cnsub=${this.has_cnsub}">欧美</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"3" === type_value ? "is-info" : ""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=3&has_cnsub=${this.has_cnsub}">Fc2</a>\n \n <a style="padding:18px 18px !important;margin-left: 50px" class="button is-small ${"1" === this.has_cnsub ? "is-info" : ""}" data-cnsub-value="1">含中字磁鏈</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"0" === this.has_cnsub ? "is-info" : ""}" data-cnsub-value="0">无字幕</a>\n <a style="padding:18px 18px !important;" class="button is-small" data-cnsub-value="">重置</a>\n </div>\n \n <div class="buttons has-addons" id="conditionBox">\n ${yearHtml}\n </div>\n </div>\n `; let conditionHtml = `\n <div class="button-group">\n <div class="buttons has-addons" id="conditionBox" style="margin-bottom: 0!important;">\n <a style="padding:18px 18px !important;" class="button is-small ${"all" === type ? "is-info" : ""}" href="/rankings/top?has_cnsub=${this.has_cnsub}">全部</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"0" === type_value ? "is-info" : ""}" href="/rankings/top?t=0&has_cnsub=${this.has_cnsub}">有码</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"1" === type_value ? "is-info" : ""}" href="/rankings/top?t=1&has_cnsub=${this.has_cnsub}">无码</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"2" === type_value ? "is-info" : ""}" href="/rankings/top?t=2&has_cnsub=${this.has_cnsub}">欧美</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"3" === type_value ? "is-info" : ""}" href="/rankings/top?t=3&has_cnsub=${this.has_cnsub}">Fc2</a>\n \n <a style="padding:18px 18px !important;margin-left: 50px" class="button is-small ${"1" === this.has_cnsub ? "is-info" : ""}" data-cnsub-value="1">含中字磁鏈</a>\n <a style="padding:18px 18px !important;" class="button is-small ${"0" === this.has_cnsub ? "is-info" : ""}" data-cnsub-value="0">无字幕</a>\n <a style="padding:18px 18px !important;" class="button is-small" data-cnsub-value="">重置</a>\n </div>\n \n <div class="buttons has-addons" id="conditionBox">\n ${yearHtml}\n </div>\n </div>\n `;
this.$contentBox.append(conditionHtml); this.$contentBox.append(conditionHtml);
$("a[data-cnsub-value]").on("click", (event => { $("a[data-cnsub-value]").on("click", (event => {
const cnsubValue = $(event.currentTarget).data("cnsub-value"); const cnsubValue = $(event.currentTarget).data("cnsub-value");
@@ -134,7 +143,8 @@ class TOP250Plugin extends BasePlugin {
type = "video_type"; type = "video_type";
type_value = t; type_value = t;
} }
let url = `/advanced_search?handleTop=1&handleType=${type}&type_value=${type_value}`; let tParam = "year" === type ? `y${type_value}` : "all" === type ? "" : type_value;
let url = `/rankings/top${tParam ? `?t=${tParam}` : ""}`;
event && (event.ctrlKey || event.metaKey) ? GM_openInTab(window.location.origin + url, { event && (event.ctrlKey || event.metaKey) ? GM_openInTab(window.location.origin + url, {
insert: 0 insert: 0
}) : window.location.href = url; }) : window.location.href = url;
@@ -167,7 +177,7 @@ class TOP250Plugin extends BasePlugin {
await localStorage.setItem("jhs_appAuthorization", token); await localStorage.setItem("jhs_appAuthorization", token);
show.ok("登录成功"); show.ok("登录成功");
layer.close(index); layer.close(index);
window.location.href = "/advanced_search?handleTop=1&period=daily"; window.location.href = "/rankings/top";
} }
} }
})).catch((err => { })).catch((err => {