fix type error

这个提交包含在:
mtvpls
2026-01-08 01:36:16 +08:00
父节点 4474c0c6f9
当前提交 9e8e3a4cc5
修改 4 个文件,包含 6 行新增6 行删除
+1 -1
查看文件
@@ -9,7 +9,7 @@ import CapsuleSwitch from '@/components/CapsuleSwitch';
import PageLayout from '@/components/PageLayout'; import PageLayout from '@/components/PageLayout';
import VideoCard from '@/components/VideoCard'; import VideoCard from '@/components/VideoCard';
type LibrarySourceType = 'openlist' | 'emby'; type LibrarySourceType = 'openlist' | 'emby' | `emby:${string}` | `emby_${string}`;
interface EmbySourceOption { interface EmbySourceOption {
key: string; key: string;
+2 -2
查看文件
@@ -1219,7 +1219,7 @@ const VideoCard = forwardRef<VideoCardHandle, VideoCardProps>(function VideoCard
{config.showSourceName && source_name && !cmsData && ( {config.showSourceName && source_name && !cmsData && (
<span <span
className={`inline-block border rounded px-1 py-0.5 text-[8px] text-white/90 bg-black/30 backdrop-blur-sm ${ className={`inline-block border rounded px-1 py-0.5 text-[8px] text-white/90 bg-black/30 backdrop-blur-sm ${
actualSource === 'openlist' || actualSource === 'emby' || actualSource.startsWith('emby_') ? 'border-yellow-500' : 'border-white/60' actualSource === 'openlist' || actualSource === 'emby' || actualSource?.startsWith('emby_') ? 'border-yellow-500' : 'border-white/60'
}`} }`}
style={{ style={{
WebkitUserSelect: 'none', WebkitUserSelect: 'none',
@@ -1269,7 +1269,7 @@ const VideoCard = forwardRef<VideoCardHandle, VideoCardProps>(function VideoCard
<div className='flex items-center justify-end'> <div className='flex items-center justify-end'>
<span <span
className={`inline-block border rounded px-1 py-0.5 text-[8px] text-white/90 bg-black/30 backdrop-blur-sm ${ className={`inline-block border rounded px-1 py-0.5 text-[8px] text-white/90 bg-black/30 backdrop-blur-sm ${
origin === 'live' ? 'border-red-500' : actualSource === 'openlist' || actualSource === 'emby' || actualSource.startsWith('emby_') ? 'border-yellow-500' : 'border-white/60' origin === 'live' ? 'border-red-500' : actualSource === 'openlist' || actualSource === 'emby' || actualSource?.startsWith('emby_') ? 'border-yellow-500' : 'border-white/60'
}`} }`}
style={{ style={{
WebkitUserSelect: 'none', WebkitUserSelect: 'none',
+2 -2
查看文件
@@ -503,7 +503,7 @@ export function configSelfCheck(adminConfig: AdminConfig): AdminConfig {
key: 'default', key: 'default',
name: 'Emby', name: 'Emby',
enabled: oldConfig.Enabled ?? false, enabled: oldConfig.Enabled ?? false,
ServerURL: oldConfig.ServerURL, ServerURL: oldConfig.ServerURL || '',
ApiKey: oldConfig.ApiKey, ApiKey: oldConfig.ApiKey,
Username: oldConfig.Username, Username: oldConfig.Username,
Password: oldConfig.Password, Password: oldConfig.Password,
@@ -518,7 +518,7 @@ export function configSelfCheck(adminConfig: AdminConfig): AdminConfig {
} }
// Emby源去重 // Emby源去重
if (adminConfig.EmbyConfig.Sources) { if (adminConfig.EmbyConfig?.Sources) {
const seenEmbyKeys = new Set<string>(); const seenEmbyKeys = new Set<string>();
adminConfig.EmbyConfig.Sources = adminConfig.EmbyConfig.Sources.filter((source) => { adminConfig.EmbyConfig.Sources = adminConfig.EmbyConfig.Sources.filter((source) => {
if (seenEmbyKeys.has(source.key)) { if (seenEmbyKeys.has(source.key)) {
+1 -1
查看文件
@@ -164,7 +164,7 @@ export function migrateEmbyConfig(config: AdminConfig): AdminConfig {
key: 'default', key: 'default',
name: 'Emby', name: 'Emby',
enabled: oldConfig.Enabled ?? false, enabled: oldConfig.Enabled ?? false,
ServerURL: oldConfig.ServerURL, ServerURL: oldConfig.ServerURL || '',
ApiKey: oldConfig.ApiKey, ApiKey: oldConfig.ApiKey,
Username: oldConfig.Username, Username: oldConfig.Username,
Password: oldConfig.Password, Password: oldConfig.Password,