diff --git a/.DS_Store b/.DS_Store index 9b1bc40..768d495 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/en/index.html b/en/index.html index 2b4890f..a584390 100644 --- a/en/index.html +++ b/en/index.html @@ -348,7 +348,7 @@

📱 EmbyX

v1.0 + 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
@@ -683,7 +683,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 }) }); @@ -792,7 +792,7 @@ const PAGE_SIZE = 99; // const MAX_GRID_VIDEOS = 1000; - 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}`; @@ -808,7 +808,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(`Server Error: ${res.status}`); } @@ -1457,10 +1461,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: [] }; localStorage.setItem('emby_views_cache', JSON.stringify({ playlists: playlistsData, views: viewsDataRaw })); diff --git a/zh/index.html b/zh/index.html index 3c94bda..7a28724 100644 --- a/zh/index.html +++ b/zh/index.html @@ -366,7 +366,7 @@

📱 EmbyX

v1.0 + 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
@@ -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: [] }; // 缓存完整的视图和列表数据供网格模式提取名称