v1.1
This commit is contained in:
+18
-6
@@ -366,7 +366,7 @@
|
||||
<div class="flex items-center">
|
||||
<h3 class="text-white font-bold text-2xl tracking-tight">📱 EmbyX</h3>
|
||||
<span
|
||||
class="ml-2 px-2 py-0.5 bg-primary/20 text-primary text-xs font-bold rounded-full border border-primary/30">v1.0</span>
|
||||
class="ml-2 px-2 py-0.5 bg-primary/20 text-primary text-xs font-bold rounded-full border border-primary/30">v1.1</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -724,7 +724,7 @@
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Emby-Authorization': `Emby Client="EmbyX", Device="Web", DeviceId="EmbyX-Device", Version="1.0"`
|
||||
'X-Emby-Authorization': `Emby Client="EmbyX", Device="Web", DeviceId="EmbyX-Device", Version="1.1"`
|
||||
},
|
||||
body: JSON.stringify({ Username: user, Pw: pwd })
|
||||
});
|
||||
@@ -842,7 +842,7 @@
|
||||
const PAGE_SIZE = 99; // 可调整,建议保持 3 的倍数
|
||||
// const MAX_GRID_VIDEOS = 1000; // 硬性上限,目前由 API TotalRecordCount 控制,留作后期限速使用
|
||||
|
||||
let url = `${server}/emby/Users/${userId}/Items?api_key=${token}&Recursive=true&IncludeItemTypes=Video&Limit=${PAGE_SIZE}&StartIndex=${this.state.startIndex || 0}&Fields=Overview,Path,RunTimeTicks,MediaSources`;
|
||||
let url = `${server}/emby/Users/${userId}/Items?api_key=${token}&Recursive=true&IncludeItemTypes=Movie,Episode,Video&Limit=${PAGE_SIZE}&StartIndex=${this.state.startIndex || 0}&Fields=Overview,Path,RunTimeTicks,MediaSources`;
|
||||
|
||||
if (ids) {
|
||||
url += `&Ids=${ids}`;
|
||||
@@ -861,7 +861,11 @@
|
||||
url += `&SortBy=DateCreated&SortOrder=Descending`;
|
||||
}
|
||||
|
||||
const res = await fetch(url);
|
||||
const res = await fetch(url, {
|
||||
headers: {
|
||||
'X-Emby-Authorization': `Emby Client="EmbyX", Device="Web", DeviceId="EmbyX-Device", Version="1.1"`
|
||||
}
|
||||
});
|
||||
if (!res.ok) {
|
||||
throw new Error(`服务器错误: ${res.status}`);
|
||||
}
|
||||
@@ -1577,10 +1581,18 @@
|
||||
try {
|
||||
const userId = this.config.userId;
|
||||
|
||||
const playlistsRes = await fetch(`${this.config.server}/emby/Users/${userId}/Items?Recursive=true&IncludeItemTypes=Playlist&api_key=${this.config.token}`);
|
||||
const playlistsRes = await fetch(`${this.config.server}/emby/Users/${userId}/Items?Recursive=true&IncludeItemTypes=Playlist&api_key=${this.config.token}`, {
|
||||
headers: {
|
||||
'X-Emby-Authorization': `Emby Client="EmbyX", Device="Web", DeviceId="EmbyX-Device", Version="1.1"`
|
||||
}
|
||||
});
|
||||
const playlistsData = await playlistsRes.json();
|
||||
|
||||
const viewsRes = await fetch(`${this.config.server}/emby/Users/${userId}/Views?api_key=${this.config.token}`);
|
||||
const viewsRes = await fetch(`${this.config.server}/emby/Users/${userId}/Views?api_key=${this.config.token}`, {
|
||||
headers: {
|
||||
'X-Emby-Authorization': `Emby Client="EmbyX", Device="Web", DeviceId="EmbyX-Device", Version="1.1"`
|
||||
}
|
||||
});
|
||||
const viewsDataRaw = viewsRes.ok ? await viewsRes.json() : { Items: [] };
|
||||
|
||||
// 缓存完整的视图和列表数据供网格模式提取名称
|
||||
|
||||
Reference in New Issue
Block a user