feat: Enhance package manager detection script and improve type safety in components
- Updated `check-package-manager.js` to disable specific ESLint rules for better readability. - Refactored `page.tsx` in the login module to remove unnecessary type assertions and improve state management. - Modified `page.tsx` in the home module to enhance error handling, improve layout with grid system, and limit displayed items. - Adjusted `PageLayout.tsx` to implement responsive layout changes for the play page. - Improved `ThemeToggle.tsx` to ensure proper dependency tracking in useEffect. - Enhanced `VideoCard.tsx` with better type definitions for favorites. - Updated `db.client.ts` to rename legacy cache prefix for future migration. - Added runtime configuration types in `types.ts` and extended global Window interface. - Introduced a new Workbox service worker file for improved caching strategies.
This commit is contained in:
@@ -590,7 +590,44 @@ KatelyaTV 支持标准的苹果 CMS V10 API 格式。
|
|||||||
|
|
||||||
[MIT](LICENSE) © 2025 KatelyaTV & Contributors
|
[MIT](LICENSE) © 2025 KatelyaTV & Contributors
|
||||||
|
|
||||||
## 🙏 致谢
|
## � Star History
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
[](https://star-history.com/#katelya77/KatelyaTV&Date)
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## 💖 支持项目
|
||||||
|
|
||||||
|
如果这个项目对您有帮助,欢迎给个 ⭐️ Star 支持一下!
|
||||||
|
|
||||||
|
您也可以通过以下方式支持项目的持续开发:
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
### 请开发者喝杯咖啡 ☕
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td align="center">
|
||||||
|
<img src="https://via.placeholder.com/200x200/00D8FF/FFFFFF?text=WeChat+Pay" alt="微信支付" width="200">
|
||||||
|
<br>
|
||||||
|
<strong>微信支付</strong>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<img src="https://via.placeholder.com/200x200/1677FF/FFFFFF?text=Alipay" alt="支付宝" width="200">
|
||||||
|
<br>
|
||||||
|
<strong>支付宝</strong>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
> 💝 感谢您的支持!您的捐赠将用于项目的持续维护和功能改进。
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## �🙏 致谢
|
||||||
|
|
||||||
- [ts-nextjs-tailwind-starter](https://github.com/theodorusclarence/ts-nextjs-tailwind-starter) — 项目最初基于该脚手架。
|
- [ts-nextjs-tailwind-starter](https://github.com/theodorusclarence/ts-nextjs-tailwind-starter) — 项目最初基于该脚手架。
|
||||||
- [LibreTV](https://github.com/LibreSpark/LibreTV) — 由此启发,站在巨人的肩膀上。
|
- [LibreTV](https://github.com/LibreSpark/LibreTV) — 由此启发,站在巨人的肩膀上。
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
20250830155949
|
20250901193125
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moontv",
|
"name": "katelyatv",
|
||||||
"version": "0.1.0",
|
"version": "0.4.0-katelya",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run gen:runtime && npm run gen:manifest && next dev -H 0.0.0.0",
|
"dev": "npm run gen:runtime && npm run gen:manifest && next dev -H 0.0.0.0",
|
||||||
|
|||||||
+1
-5
@@ -1,5 +1 @@
|
|||||||
<<<<<<< Current (Your changes)
|
if(!self.define){let e,s={};const n=(n,t)=>(n=new URL(n+".js",t).href,s[n]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()}).then(()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(t,c)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(s[i])return;let a={};const r=e=>n(e,i),o={module:{uri:i},exports:a,require:r};s[i]=Promise.all(t.map(e=>o[e]||r(e))).then(e=>(c(...e),a))}}define(["./workbox-4754cb34"],function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"4cc81709a85016d2e1325aec145aa599"},{url:"/_next/static/chunks/100-efcc706557360c1e.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/117-712c1385f002eef0.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/262-b67318e67f316783.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/41ade5dc-797c284ea15e5986.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/519-9968375803c5bb08.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/827-35ccbd32f32feb33.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/872-010f54d5928bfbfd.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/886-b0b555a14550a8dc.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/97-d35e729ca3ec6714.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/a4634e51-a3fb94d869211083.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/_not-found/page-231758babf57b819.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/admin/page-094e47d9aa7845e0.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/douban/page-75ce0c7d2b4cff9c.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/layout-870a3b1d3b21202a.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/login/page-b79e53e406bf669d.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/page-61b1291c1aa52317.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/play/page-d478c791ff7bae46.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/search/page-2e6fb9284b7fe3b7.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/warning/page-6c04923bb35d02d2.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/fd9d1056-5fb180716357b830.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/framework-f66176bb897dc684.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/main-33b2d4bbe5672234.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/main-app-073eb01104a135dc.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/pages/_app-72b849fbd24ac258.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/pages/_error-7ba65e1336b92748.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/polyfills-42372ed130431b0a.js",revision:"846118c33b2c0e922d7b3a7676f81f6f"},{url:"/_next/static/chunks/webpack-05e23bcac07e9541.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/css/01f6801b310b5690.css",revision:"01f6801b310b5690"},{url:"/_next/static/css/275ed64cc4367444.css",revision:"275ed64cc4367444"},{url:"/_next/static/css/2da794711423e5a1.css",revision:"2da794711423e5a1"},{url:"/_next/static/m91B5pHK189d_DOw2NJtJ/_buildManifest.js",revision:"c155cce658e53418dec34664328b51ac"},{url:"/_next/static/m91B5pHK189d_DOw2NJtJ/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/media/26a46d62cd723877-s.woff2",revision:"befd9c0fdfa3d8a645d5f95717ed6420"},{url:"/_next/static/media/55c55f0601d81cf3-s.woff2",revision:"43828e14271c77b87e3ed582dbff9f74"},{url:"/_next/static/media/581909926a08bbc8-s.woff2",revision:"f0b86e7c24f455280b8df606b89af891"},{url:"/_next/static/media/8e9860b6e62d6359-s.woff2",revision:"01ba6c2a184b8cba08b0d57167664d75"},{url:"/_next/static/media/97e0cb1ae144a2a9-s.woff2",revision:"e360c61c5bd8d90639fd4503c829c2dc"},{url:"/_next/static/media/df0a9ae256c0569c-s.woff2",revision:"d54db44de5ccb18886ece2fda72bdfe0"},{url:"/_next/static/media/e4af272ccee01ff0-s.p.woff2",revision:"65850a373e258f1c897a2b3d75eb74de"},{url:"/favicon.ico",revision:"c5de6e56c5664adda146825f75ea6ecf"},{url:"/icons/icon-192x192.png",revision:"4a56c090828a1ad254c903c7aec0389d"},{url:"/icons/icon-256x256.png",revision:"f6409eb1a001f754121e3a8281c0319c"},{url:"/icons/icon-384x384.png",revision:"f6efc3e357b9ffdf4e0d8c14b2ed0ac1"},{url:"/icons/icon-512x512.png",revision:"9c008cbbeb6a576fe07bb1284a83f4d2"},{url:"/logo.png",revision:"40de611b143c47c6291c7bdad2c959ca"},{url:"/manifest.json",revision:"7bd3dabc1cfbfe40f09577efca223d31"},{url:"/robots.txt",revision:"e2b2cd8514443456bc6fb9d77b3b1f3e"},{url:"/screenshot1.png",revision:"10572bfcea54dc93ac4c5f7c9057fc98"},{url:"/screenshot2.png",revision:"f815a8990973a221899976867365c239"},{url:"/screenshot3.png",revision:"49709e96345dfeeab1d8083821d4b44e"},{url:"/screenshot4.png",revision:"a76c751e41e37556048a487e4f8b8b1c"}],{ignoreURLParametersMatching:[]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({request:e,response:s,event:n,state:t})=>s&&"opaqueredirect"===s.type?new Response(s.body,{status:200,statusText:"OK",headers:s.headers}):s}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>{if(!(self.origin===e.origin))return!1;const s=e.pathname;return!s.startsWith("/api/auth/")&&!!s.startsWith("/api/")},new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>{if(!(self.origin===e.origin))return!1;return!e.pathname.startsWith("/api/")},new e.NetworkFirst({cacheName:"others",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>!(self.origin===e.origin),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")});
|
||||||
if(!self.define){let e,s={};const n=(n,t)=>(n=new URL(n+".js",t).href,s[n]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()}).then(()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(t,a)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(s[i])return;let c={};const r=e=>n(e,i),o={module:{uri:i},exports:c,require:r};s[i]=Promise.all(t.map(e=>o[e]||r(e))).then(e=>(a(...e),c))}}define(["./workbox-e9849328"],function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"1f7f5a2aec7f945336c0ae43e2e57c47"},{url:"/_next/static/6qB3epXmqsAy-GeVOS_bt/_buildManifest.js",revision:"85aecd8a55db42fc901f52386fd2a680"},{url:"/_next/static/6qB3epXmqsAy-GeVOS_bt/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/chunks/151-467740e7dc8a9501.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/242-3804d87f50553b94.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/402-0111ac7d0edfee14.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/484-4de9b8ccd6b187b0.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/609-bd706105e16d4e38.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/78-2f748e0c099ee9b7.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/866-d2269a3038f10b5a.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/887-3888edb42bd5ac06.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/app/_not-found/page-d6cb5fee19b812f4.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/app/admin/page-02699fb3c7542f31.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/app/douban/page-6cadcedaf8538fd6.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/app/layout-f2be6b03f6eb1026.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/app/login/page-9a89981161d4a992.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/app/page-fd24f7135fef556d.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/app/play/page-648b8b5fd8c19287.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/app/search/page-89eb23c28fc11ef5.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/app/warning/page-e6b20b93b37dc516.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/b145b63a-b7e49c063d2fa255.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/c72274ce-909438a8a5dd87a5.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/da9543df-c2ce5269243dd748.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/framework-6e06c675866dc992.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/main-app-0cf6afdd74694b9f.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/main-e84422daeb8eaf88.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/pages/_app-3fcac1a2c632f1ef.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/pages/_error-d3fe151bf402c134.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/chunks/polyfills-42372ed130431b0a.js",revision:"846118c33b2c0e922d7b3a7676f81f6f"},{url:"/_next/static/chunks/webpack-4a57793b45c0f940.js",revision:"6qB3epXmqsAy-GeVOS_bt"},{url:"/_next/static/css/23100062f5d4aac0.css",revision:"23100062f5d4aac0"},{url:"/_next/static/css/a7b7a98490e311ff.css",revision:"a7b7a98490e311ff"},{url:"/_next/static/media/26a46d62cd723877-s.woff2",revision:"befd9c0fdfa3d8a645d5f95717ed6420"},{url:"/_next/static/media/55c55f0601d81cf3-s.woff2",revision:"43828e14271c77b87e3ed582dbff9f74"},{url:"/_next/static/media/581909926a08bbc8-s.woff2",revision:"f0b86e7c24f455280b8df606b89af891"},{url:"/_next/static/media/8e9860b6e62d6359-s.woff2",revision:"01ba6c2a184b8cba08b0d57167664d75"},{url:"/_next/static/media/97e0cb1ae144a2a9-s.woff2",revision:"e360c61c5bd8d90639fd4503c829c2dc"},{url:"/_next/static/media/df0a9ae256c0569c-s.woff2",revision:"d54db44de5ccb18886ece2fda72bdfe0"},{url:"/_next/static/media/e4af272ccee01ff0-s.p.woff2",revision:"65850a373e258f1c897a2b3d75eb74de"},{url:"/favicon.ico",revision:"c5de6e56c5664adda146825f75ea6ecf"},{url:"/icons/icon-192x192.png",revision:"4a56c090828a1ad254c903c7aec0389d"},{url:"/icons/icon-256x256.png",revision:"f6409eb1a001f754121e3a8281c0319c"},{url:"/icons/icon-384x384.png",revision:"f6efc3e357b9ffdf4e0d8c14b2ed0ac1"},{url:"/icons/icon-512x512.png",revision:"9c008cbbeb6a576fe07bb1284a83f4d2"},{url:"/logo.png",revision:"40de611b143c47c6291c7bdad2c959ca"},{url:"/manifest.json",revision:"7bd3dabc1cfbfe40f09577efca223d31"},{url:"/robots.txt",revision:"0483b37fb6cf7455cefe516197e39241"},{url:"/screenshot.png",revision:"05a86e8d4faae6b384d19f02173ea87f"},{url:"/screenshot1.png",revision:"d7de3a25686c5b9c9d8c8675bc6109fc"},{url:"/screenshot2.png",revision:"b0b715a3018d2f02aba5d94762473bb6"},{url:"/screenshot3.png",revision:"7e454c28e110e291ee12f494fb3cf40c"}],{ignoreURLParametersMatching:[]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({request:e,response:s,event:n,state:t})=>s&&"opaqueredirect"===s.type?new Response(s.body,{status:200,statusText:"OK",headers:s.headers}):s}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>{if(!(self.origin===e.origin))return!1;const s=e.pathname;return!s.startsWith("/api/auth/")&&!!s.startsWith("/api/")},new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>{if(!(self.origin===e.origin))return!1;return!e.pathname.startsWith("/api/")},new e.NetworkFirst({cacheName:"others",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>!(self.origin===e.origin),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")});
|
|
||||||
=======
|
|
||||||
if(!self.define){let e,s={};const n=(n,a)=>(n=new URL(n+".js",a).href,s[n]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()}).then(()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(a,i)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(s[c])return;let t={};const r=e=>n(e,c),o={module:{uri:c},exports:t,require:r};s[c]=Promise.all(a.map(e=>o[e]||r(e))).then(e=>(i(...e),t))}}define(["./workbox-e9849328"],function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"e835516f55e089231cd3a13c3d1bfcfb"},{url:"/_next/static/I621_uJyyXyq0s9YsYe1C/_buildManifest.js",revision:"85aecd8a55db42fc901f52386fd2a680"},{url:"/_next/static/I621_uJyyXyq0s9YsYe1C/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/chunks/151-467740e7dc8a9501.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/242-3804d87f50553b94.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/402-0111ac7d0edfee14.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/484-4de9b8ccd6b187b0.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/609-bd706105e16d4e38.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/78-2f748e0c099ee9b7.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/866-d2269a3038f10b5a.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/887-3888edb42bd5ac06.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/app/_not-found/page-d6cb5fee19b812f4.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/app/admin/page-02699fb3c7542f31.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/app/douban/page-6cadcedaf8538fd6.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/app/layout-f2be6b03f6eb1026.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/app/login/page-9a89981161d4a992.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/app/page-fd24f7135fef556d.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/app/play/page-648b8b5fd8c19287.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/app/search/page-89eb23c28fc11ef5.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/app/warning/page-e6b20b93b37dc516.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/b145b63a-b7e49c063d2fa255.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/c72274ce-909438a8a5dd87a5.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/da9543df-c2ce5269243dd748.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/framework-6e06c675866dc992.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/main-app-0cf6afdd74694b9f.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/main-e84422daeb8eaf88.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/pages/_app-3fcac1a2c632f1ef.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/pages/_error-d3fe151bf402c134.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/chunks/polyfills-42372ed130431b0a.js",revision:"846118c33b2c0e922d7b3a7676f81f6f"},{url:"/_next/static/chunks/webpack-4a57793b45c0f940.js",revision:"I621_uJyyXyq0s9YsYe1C"},{url:"/_next/static/css/23100062f5d4aac0.css",revision:"23100062f5d4aac0"},{url:"/_next/static/css/a7b7a98490e311ff.css",revision:"a7b7a98490e311ff"},{url:"/_next/static/media/26a46d62cd723877-s.woff2",revision:"befd9c0fdfa3d8a645d5f95717ed6420"},{url:"/_next/static/media/55c55f0601d81cf3-s.woff2",revision:"43828e14271c77b87e3ed582dbff9f74"},{url:"/_next/static/media/581909926a08bbc8-s.woff2",revision:"f0b86e7c24f455280b8df606b89af891"},{url:"/_next/static/media/8e9860b6e62d6359-s.woff2",revision:"01ba6c2a184b8cba08b0d57167664d75"},{url:"/_next/static/media/97e0cb1ae144a2a9-s.woff2",revision:"e360c61c5bd8d90639fd4503c829c2dc"},{url:"/_next/static/media/df0a9ae256c0569c-s.woff2",revision:"d54db44de5ccb18886ece2fda72bdfe0"},{url:"/_next/static/media/e4af272ccee01ff0-s.p.woff2",revision:"65850a373e258f1c897a2b3d75eb74de"},{url:"/favicon.ico",revision:"c5de6e56c5664adda146825f75ea6ecf"},{url:"/icons/icon-192x192.png",revision:"4a56c090828a1ad254c903c7aec0389d"},{url:"/icons/icon-256x256.png",revision:"f6409eb1a001f754121e3a8281c0319c"},{url:"/icons/icon-384x384.png",revision:"f6efc3e357b9ffdf4e0d8c14b2ed0ac1"},{url:"/icons/icon-512x512.png",revision:"9c008cbbeb6a576fe07bb1284a83f4d2"},{url:"/logo.png",revision:"40de611b143c47c6291c7bdad2c959ca"},{url:"/manifest.json",revision:"7bd3dabc1cfbfe40f09577efca223d31"},{url:"/robots.txt",revision:"0483b37fb6cf7455cefe516197e39241"},{url:"/screenshot.png",revision:"05a86e8d4faae6b384d19f02173ea87f"},{url:"/screenshot1.png",revision:"d7de3a25686c5b9c9d8c8675bc6109fc"},{url:"/screenshot2.png",revision:"b0b715a3018d2f02aba5d94762473bb6"},{url:"/screenshot3.png",revision:"7e454c28e110e291ee12f494fb3cf40c"}],{ignoreURLParametersMatching:[]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({request:e,response:s,event:n,state:a})=>s&&"opaqueredirect"===s.type?new Response(s.body,{status:200,statusText:"OK",headers:s.headers}):s}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>{if(!(self.origin===e.origin))return!1;const s=e.pathname;return!s.startsWith("/api/auth/")&&!!s.startsWith("/api/")},new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>{if(!(self.origin===e.origin))return!1;return!e.pathname.startsWith("/api/")},new e.NetworkFirst({cacheName:"others",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>!(self.origin===e.origin),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")});
|
|
||||||
>>>>>>> Incoming (Background Agent changes)
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/* eslint-disable @typescript-eslint/no-var-requires, no-console */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 智能包管理器检测和推荐脚本
|
* 智能包管理器检测和推荐脚本
|
||||||
* 帮助用户选择最适合的包管理器
|
* 帮助用户选择最适合的包管理器
|
||||||
@@ -7,7 +9,6 @@
|
|||||||
|
|
||||||
const { execSync } = require('child_process');
|
const { execSync } = require('child_process');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
console.log('🔍 检测包管理器环境...\n');
|
console.log('🔍 检测包管理器环境...\n');
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { AlertCircle, CheckCircle } from 'lucide-react';
|
import { AlertCircle, CheckCircle } from 'lucide-react';
|
||||||
@@ -85,10 +83,10 @@ function LoginPageClient() {
|
|||||||
// 在客户端挂载后设置配置
|
// 在客户端挂载后设置配置
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
const storageType = (window as any).RUNTIME_CONFIG?.STORAGE_TYPE;
|
const storageType = window.RUNTIME_CONFIG?.STORAGE_TYPE;
|
||||||
setShouldAskUsername(storageType && storageType !== 'localstorage');
|
setShouldAskUsername(Boolean(storageType && storageType !== 'localstorage'));
|
||||||
setEnableRegister(
|
setEnableRegister(
|
||||||
Boolean((window as any).RUNTIME_CONFIG?.ENABLE_REGISTER)
|
Boolean(window.RUNTIME_CONFIG?.ENABLE_REGISTER)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
+30
-29
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any, react-hooks/exhaustive-deps, no-console */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
|
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
@@ -8,6 +8,7 @@ import { Suspense, useEffect, useState } from 'react';
|
|||||||
|
|
||||||
// 客户端收藏 API
|
// 客户端收藏 API
|
||||||
import {
|
import {
|
||||||
|
type Favorite,
|
||||||
clearAllFavorites,
|
clearAllFavorites,
|
||||||
getAllFavorites,
|
getAllFavorites,
|
||||||
getAllPlayRecords,
|
getAllPlayRecords,
|
||||||
@@ -19,7 +20,6 @@ import { DoubanItem } from '@/lib/types';
|
|||||||
import CapsuleSwitch from '@/components/CapsuleSwitch';
|
import CapsuleSwitch from '@/components/CapsuleSwitch';
|
||||||
import ContinueWatching from '@/components/ContinueWatching';
|
import ContinueWatching from '@/components/ContinueWatching';
|
||||||
import PageLayout from '@/components/PageLayout';
|
import PageLayout from '@/components/PageLayout';
|
||||||
import ScrollableRow from '@/components/ScrollableRow';
|
|
||||||
import { useSite } from '@/components/SiteProvider';
|
import { useSite } from '@/components/SiteProvider';
|
||||||
import VideoCard from '@/components/VideoCard';
|
import VideoCard from '@/components/VideoCard';
|
||||||
|
|
||||||
@@ -137,7 +137,8 @@ function HomeClient() {
|
|||||||
setHotVarietyShows(varietyShowsData.list);
|
setHotVarietyShows(varietyShowsData.list);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取豆瓣数据失败:', error);
|
// 静默处理错误,避免控制台警告
|
||||||
|
// console.error('获取豆瓣数据失败:', error);
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -147,7 +148,7 @@ function HomeClient() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// 处理收藏数据更新的函数
|
// 处理收藏数据更新的函数
|
||||||
const updateFavoriteItems = async (allFavorites: Record<string, any>) => {
|
const updateFavoriteItems = async (allFavorites: Record<string, Favorite>) => {
|
||||||
const allPlayRecords = await getAllPlayRecords();
|
const allPlayRecords = await getAllPlayRecords();
|
||||||
|
|
||||||
// 根据保存时间排序(从近到远)
|
// 根据保存时间排序(从近到远)
|
||||||
@@ -191,7 +192,7 @@ function HomeClient() {
|
|||||||
// 监听收藏更新事件
|
// 监听收藏更新事件
|
||||||
const unsubscribe = subscribeToDataUpdates(
|
const unsubscribe = subscribeToDataUpdates(
|
||||||
'favoritesUpdated',
|
'favoritesUpdated',
|
||||||
(newFavorites: Record<string, any>) => {
|
(newFavorites: Record<string, Favorite>) => {
|
||||||
updateFavoriteItems(newFavorites);
|
updateFavoriteItems(newFavorites);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -290,13 +291,13 @@ function HomeClient() {
|
|||||||
<ChevronRight className='w-4 h-4 ml-1' />
|
<ChevronRight className='w-4 h-4 ml-1' />
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<ScrollableRow>
|
<div className='grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4'>
|
||||||
{loading
|
{loading
|
||||||
? // 加载状态显示灰色占位数据
|
? // 加载状态显示灰色占位数据 (显示10个,2行x5列)
|
||||||
Array.from({ length: 8 }).map((_, index) => (
|
Array.from({ length: 10 }).map((_, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className='min-w-[96px] w-24 sm:min-w-[180px] sm:w-44'
|
className='w-full'
|
||||||
>
|
>
|
||||||
<div className='relative aspect-[2/3] w-full overflow-hidden rounded-lg bg-purple-200 animate-pulse dark:bg-purple-800'>
|
<div className='relative aspect-[2/3] w-full overflow-hidden rounded-lg bg-purple-200 animate-pulse dark:bg-purple-800'>
|
||||||
<div className='absolute inset-0 bg-purple-300 dark:bg-purple-700'></div>
|
<div className='absolute inset-0 bg-purple-300 dark:bg-purple-700'></div>
|
||||||
@@ -304,11 +305,11 @@ function HomeClient() {
|
|||||||
<div className='mt-2 h-4 bg-purple-200 rounded animate-pulse dark:bg-purple-800'></div>
|
<div className='mt-2 h-4 bg-purple-200 rounded animate-pulse dark:bg-purple-800'></div>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
: // 显示真实数据
|
: // 显示真实数据,只显示前10个实现2行布局
|
||||||
hotMovies.map((movie, index) => (
|
hotMovies.slice(0, 10).map((movie, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className='min-w-[96px] w-24 sm:min-w-[180px] sm:w-44'
|
className='w-full'
|
||||||
>
|
>
|
||||||
<VideoCard
|
<VideoCard
|
||||||
from='douban'
|
from='douban'
|
||||||
@@ -321,7 +322,7 @@ function HomeClient() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</ScrollableRow>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{/* 热门剧集 */}
|
{/* 热门剧集 */}
|
||||||
@@ -338,13 +339,13 @@ function HomeClient() {
|
|||||||
<ChevronRight className='w-4 h-4 ml-1' />
|
<ChevronRight className='w-4 h-4 ml-1' />
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<ScrollableRow>
|
<div className='grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4'>
|
||||||
{loading
|
{loading
|
||||||
? // 加载状态显示灰色占位数据
|
? // 加载状态显示灰色占位数据 (显示10个,2行x5列)
|
||||||
Array.from({ length: 8 }).map((_, index) => (
|
Array.from({ length: 10 }).map((_, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className='min-w-[96px] w-24 sm:min-w-[180px] sm:w-44'
|
className='w-full'
|
||||||
>
|
>
|
||||||
<div className='relative aspect-[2/3] w-full overflow-hidden rounded-lg bg-purple-200 animate-pulse dark:bg-purple-800'>
|
<div className='relative aspect-[2/3] w-full overflow-hidden rounded-lg bg-purple-200 animate-pulse dark:bg-purple-800'>
|
||||||
<div className='absolute inset-0 bg-purple-300 dark:bg-purple-700'></div>
|
<div className='absolute inset-0 bg-purple-300 dark:bg-purple-700'></div>
|
||||||
@@ -352,11 +353,11 @@ function HomeClient() {
|
|||||||
<div className='mt-2 h-4 bg-purple-200 rounded animate-pulse dark:bg-purple-800'></div>
|
<div className='mt-2 h-4 bg-purple-200 rounded animate-pulse dark:bg-purple-800'></div>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
: // 显示真实数据
|
: // 显示真实数据,只显示前10个实现2行布局
|
||||||
hotTvShows.map((show, index) => (
|
hotTvShows.slice(0, 10).map((show, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className='min-w-[96px] w-24 sm:min-w-[180px] sm:w-44'
|
className='w-full'
|
||||||
>
|
>
|
||||||
<VideoCard
|
<VideoCard
|
||||||
from='douban'
|
from='douban'
|
||||||
@@ -368,7 +369,7 @@ function HomeClient() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</ScrollableRow>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{/* 热门综艺 */}
|
{/* 热门综艺 */}
|
||||||
@@ -385,13 +386,13 @@ function HomeClient() {
|
|||||||
<ChevronRight className='w-4 h-4 ml-1' />
|
<ChevronRight className='w-4 h-4 ml-1' />
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<ScrollableRow>
|
<div className='grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4'>
|
||||||
{loading
|
{loading
|
||||||
? // 加载状态显示灰色占位数据
|
? // 加载状态显示灰色占位数据 (显示10个,2行x5列)
|
||||||
Array.from({ length: 8 }).map((_, index) => (
|
Array.from({ length: 10 }).map((_, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className='min-w-[96px] w-24 sm:min-w-[180px] sm:w-44'
|
className='w-full'
|
||||||
>
|
>
|
||||||
<div className='relative aspect-[2/3] w-full overflow-hidden rounded-lg bg-purple-200 animate-pulse dark:bg-purple-800'>
|
<div className='relative aspect-[2/3] w-full overflow-hidden rounded-lg bg-purple-200 animate-pulse dark:bg-purple-800'>
|
||||||
<div className='absolute inset-0 bg-purple-300 dark:bg-purple-700'></div>
|
<div className='absolute inset-0 bg-purple-300 dark:bg-purple-700'></div>
|
||||||
@@ -399,11 +400,11 @@ function HomeClient() {
|
|||||||
<div className='mt-2 h-4 bg-purple-200 rounded animate-pulse dark:bg-purple-800'></div>
|
<div className='mt-2 h-4 bg-purple-200 rounded animate-pulse dark:bg-purple-800'></div>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
: // 显示真实数据
|
: // 显示真实数据,只显示前10个实现2行布局
|
||||||
hotVarietyShows.map((show, index) => (
|
hotVarietyShows.slice(0, 10).map((show, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className='min-w-[96px] w-24 sm:min-w-[180px] sm:w-44'
|
className='w-full'
|
||||||
>
|
>
|
||||||
<VideoCard
|
<VideoCard
|
||||||
from='douban'
|
from='douban'
|
||||||
@@ -415,7 +416,7 @@ function HomeClient() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</ScrollableRow>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{/* 首页底部 Logo */}
|
{/* 首页底部 Logo */}
|
||||||
|
|||||||
@@ -183,20 +183,24 @@ const PageLayout = ({ children, activePath = '/' }: PageLayoutProps) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 主内容容器 - 修改布局实现完全居中:左右各留白1/6,主内容区占2/3 */}
|
{/* 主内容容器 - 为播放页面使用特殊布局(83.33%宽度),其他页面使用默认布局(66.67%宽度) */}
|
||||||
<main className='flex-1 md:min-h-0 mb-14 md:mb-0 md:p-6 lg:p-8'>
|
<main className='flex-1 md:min-h-0 mb-14 md:mb-0 md:p-6 lg:p-8'>
|
||||||
{/* 使用flex布局实现三等分 */}
|
{/* 使用flex布局实现宽度控制 */}
|
||||||
<div className='flex w-full min-h-screen md:min-h-[calc(100vh-10rem)]'>
|
<div className='flex w-full min-h-screen md:min-h-[calc(100vh-10rem)]'>
|
||||||
{/* 左侧留白区域 - 占1/6 */}
|
{/* 左侧留白区域 - 播放页面占8.33%,其他页面占16.67% */}
|
||||||
<div
|
<div
|
||||||
className='hidden md:block flex-shrink-0'
|
className='hidden md:block flex-shrink-0'
|
||||||
style={{ width: '16.67%' }}
|
style={{
|
||||||
|
width: ['/play'].includes(activePath) ? '8.33%' : '16.67%'
|
||||||
|
}}
|
||||||
></div>
|
></div>
|
||||||
|
|
||||||
{/* 主内容区 - 占2/3 */}
|
{/* 主内容区 - 播放页面占83.33%,其他页面占66.67% */}
|
||||||
<div
|
<div
|
||||||
className='flex-1 md:flex-none rounded-container w-full'
|
className='flex-1 md:flex-none rounded-container w-full'
|
||||||
style={{ width: '66.67%' }}
|
style={{
|
||||||
|
width: ['/play'].includes(activePath) ? '83.33%' : '66.67%'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className='p-4 md:p-8 lg:p-10'
|
className='p-4 md:p-8 lg:p-10'
|
||||||
@@ -208,10 +212,12 @@ const PageLayout = ({ children, activePath = '/' }: PageLayoutProps) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 右侧留白区域 - 占1/6 */}
|
{/* 右侧留白区域 - 播放页面占8.33%,其他页面占16.67% */}
|
||||||
<div
|
<div
|
||||||
className='hidden md:block flex-shrink-0'
|
className='hidden md:block flex-shrink-0'
|
||||||
style={{ width: '16.67%' }}
|
style={{
|
||||||
|
width: ['/play'].includes(activePath) ? '8.33%' : '16.67%'
|
||||||
|
}}
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any,react-hooks/exhaustive-deps */
|
|
||||||
|
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { Moon, Sun } from 'lucide-react';
|
import { Moon, Sun } from 'lucide-react';
|
||||||
@@ -25,7 +23,7 @@ export function ThemeToggle() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setMounted(true);
|
setMounted(true);
|
||||||
setThemeColor(resolvedTheme);
|
setThemeColor(resolvedTheme);
|
||||||
}, []);
|
}, [resolvedTheme]);
|
||||||
|
|
||||||
if (!mounted) {
|
if (!mounted) {
|
||||||
// 渲染一个占位符以避免布局偏移
|
// 渲染一个占位符以避免布局偏移
|
||||||
@@ -36,12 +34,18 @@ export function ThemeToggle() {
|
|||||||
// 检查浏览器是否支持 View Transitions API
|
// 检查浏览器是否支持 View Transitions API
|
||||||
const targetTheme = resolvedTheme === 'dark' ? 'light' : 'dark';
|
const targetTheme = resolvedTheme === 'dark' ? 'light' : 'dark';
|
||||||
setThemeColor(targetTheme);
|
setThemeColor(targetTheme);
|
||||||
if (!(document as any).startViewTransition) {
|
|
||||||
|
// 使用更好的类型定义
|
||||||
|
const documentWithTransition = document as Document & {
|
||||||
|
startViewTransition?: (callback: () => void) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!documentWithTransition.startViewTransition) {
|
||||||
setTheme(targetTheme);
|
setTheme(targetTheme);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
(document as any).startViewTransition(() => {
|
documentWithTransition.startViewTransition(() => {
|
||||||
setTheme(targetTheme);
|
setTheme(targetTheme);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
||||||
import { CheckCircle, Heart, Link, PlayCircleIcon } from 'lucide-react';
|
import { CheckCircle, Heart, Link, PlayCircleIcon } from 'lucide-react';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
type Favorite,
|
||||||
deleteFavorite,
|
deleteFavorite,
|
||||||
deletePlayRecord,
|
deletePlayRecord,
|
||||||
generateStorageKey,
|
generateStorageKey,
|
||||||
@@ -131,7 +130,7 @@ export default function VideoCard({
|
|||||||
const storageKey = generateStorageKey(actualSource, actualId);
|
const storageKey = generateStorageKey(actualSource, actualId);
|
||||||
const unsubscribe = subscribeToDataUpdates(
|
const unsubscribe = subscribeToDataUpdates(
|
||||||
'favoritesUpdated',
|
'favoritesUpdated',
|
||||||
(newFavorites: Record<string, any>) => {
|
(newFavorites: Record<string, Favorite>) => {
|
||||||
// 检查当前项目是否在新的收藏列表中
|
// 检查当前项目是否在新的收藏列表中
|
||||||
const isNowFavorited = !!newFavorites[storageKey];
|
const isNowFavorited = !!newFavorites[storageKey];
|
||||||
setFavorited(isNowFavorited);
|
setFavorited(isNowFavorited);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const LEGACY_SEARCH_HISTORY_KEY = 'moontv_search_history';
|
|||||||
|
|
||||||
// 缓存相关常量
|
// 缓存相关常量
|
||||||
const CACHE_PREFIX = 'katelyatv_cache_';
|
const CACHE_PREFIX = 'katelyatv_cache_';
|
||||||
const LEGACY_CACHE_PREFIX = 'moontv_cache_';
|
const _LEGACY_CACHE_PREFIX = 'moontv_cache_'; // 保留用于将来的迁移功能
|
||||||
const CACHE_VERSION = '1.0.0';
|
const CACHE_VERSION = '1.0.0';
|
||||||
const CACHE_EXPIRE_TIME = 60 * 60 * 1000; // 一小时缓存过期
|
const CACHE_EXPIRE_TIME = 60 * 60 * 1000; // 一小时缓存过期
|
||||||
|
|
||||||
|
|||||||
@@ -95,3 +95,18 @@ export interface DoubanResult {
|
|||||||
message: string;
|
message: string;
|
||||||
list: DoubanItem[];
|
list: DoubanItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Runtime配置类型
|
||||||
|
export interface RuntimeConfig {
|
||||||
|
STORAGE_TYPE?: string;
|
||||||
|
ENABLE_REGISTER?: boolean;
|
||||||
|
IMAGE_PROXY?: string;
|
||||||
|
DOUBAN_PROXY?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 全局Window类型扩展
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
RUNTIME_CONFIG?: RuntimeConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user