mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Detect empty list
This commit is contained in:
parent
3714f8f3fc
commit
c933988f3a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
min/custom-navbar.min.js
vendored
2
min/custom-navbar.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1382,6 +1382,9 @@ class WatchlaterList extends VideoList {
|
|||||||
apiUrl: "https://api.bilibili.com/x/v2/history/toview/web",
|
apiUrl: "https://api.bilibili.com/x/v2/history/toview/web",
|
||||||
listName: "watchlater",
|
listName: "watchlater",
|
||||||
listMap: json => {
|
listMap: json => {
|
||||||
|
if (!json.data.list) {
|
||||||
|
return /*html*/`<li class="loading empty">空空如也哦 = ̄ω ̄=</li>`
|
||||||
|
}
|
||||||
return json.data.list.slice(0, 6).map(item => {
|
return json.data.list.slice(0, 6).map(item => {
|
||||||
const href = (() => {
|
const href = (() => {
|
||||||
if (item.pages === undefined) {
|
if (item.pages === undefined) {
|
||||||
@ -1396,7 +1399,7 @@ class WatchlaterList extends VideoList {
|
|||||||
`https://www.bilibili.com/watchlater/#/av${item.aid}/p${page}`;
|
`https://www.bilibili.com/watchlater/#/av${item.aid}/p${page}`;
|
||||||
})();
|
})();
|
||||||
return /*html*/`<li><a target="_blank" href="${href}">${item.title}</a></li>`;
|
return /*html*/`<li><a target="_blank" href="${href}">${item.title}</a></li>`;
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.active = document.URL.startsWith("https://www.bilibili.com/watchlater/");
|
this.active = document.URL.startsWith("https://www.bilibili.com/watchlater/");
|
||||||
@ -1410,6 +1413,9 @@ class FavoritesList extends VideoList {
|
|||||||
apiUrl: "https://api.bilibili.com/medialist/gateway/coll/resource/recent",
|
apiUrl: "https://api.bilibili.com/medialist/gateway/coll/resource/recent",
|
||||||
listName: "favorites",
|
listName: "favorites",
|
||||||
listMap: json => {
|
listMap: json => {
|
||||||
|
if (!json.data || json.data.length === 0) {
|
||||||
|
return /*html*/`<li class="loading empty">空空如也哦 = ̄ω ̄=</li>`
|
||||||
|
}
|
||||||
return json.data.map(item => {
|
return json.data.map(item => {
|
||||||
return /*html*/`
|
return /*html*/`
|
||||||
<li>
|
<li>
|
||||||
@ -1429,6 +1435,9 @@ class HistoryList extends VideoList {
|
|||||||
apiUrl: "https://api.bilibili.com/x/v2/history?pn=1&ps=6",
|
apiUrl: "https://api.bilibili.com/x/v2/history?pn=1&ps=6",
|
||||||
listName: "history",
|
listName: "history",
|
||||||
listMap: json => {
|
listMap: json => {
|
||||||
|
if (!json.data || json.data.length === 0) {
|
||||||
|
return /*html*/`<li class="loading empty">空空如也哦 = ̄ω ̄=</li>`
|
||||||
|
}
|
||||||
return json.data.map(item => {
|
return json.data.map(item => {
|
||||||
let parameter = [];
|
let parameter = [];
|
||||||
let description = "";
|
let description = "";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user