5 Commits

Author SHA1 Message Date
zimplexing
cfb3982611 fix(api): update getResources method to fetch from admin config and add safety checks for SourceConfig 2025-08-15 16:56:06 +08:00
zimplexing
7f0085361b chore(version): remove version field from app.json 2025-08-15 15:58:59 +08:00
zimplexing
3e3796ab5c fix(update): update GitHub URLs in UpdateConfig and bump version to 1.3.3 2025-08-15 15:53:49 +08:00
Xin
9fcdf4b5aa Update package.json 2025-08-15 15:25:17 +08:00
Xin
db7372d732 Merge pull request #143 from orion-lib/v1.3.2
feat(player): implement playback speed control with persistent settings
2025-08-15 15:24:04 +08:00
4 changed files with 28 additions and 7 deletions

View File

@@ -36,7 +36,6 @@
},
"name": "OrionTV",
"slug": "OrionTV",
"version": "1.3.0",
"orientation": "default",
"icon": "./assets/images/icon.png",
"userInterfaceStyle": "dark",

View File

@@ -7,11 +7,11 @@ export const UPDATE_CONFIG = {
// GitHub相关URL
GITHUB_RAW_URL:
"https://gh-proxy.com/https://raw.githubusercontent.com/zimplexing/OrionTV/refs/heads/master/package.json",
"https://gh-proxy.com/https://raw.githubusercontent.com/orion-lib/OrionTV/refs/heads/master/package.json",
// 获取平台特定的下载URL
getDownloadUrl(version: string): string {
return `https://gh-proxy.com/https://github.com/zimplexing/OrionTV/releases/download/v${version}/orionTV.${version}.apk`;
return `https://gh-proxy.com/https://github.com/orion-lib/OrionTV/releases/download/v${version}/orionTV.${version}.apk`;
},
// 是否显示更新日志

View File

@@ -2,7 +2,7 @@
"name": "OrionTV",
"private": true,
"main": "expo-router/entry",
"version": "1.3.1",
"version": "1.3.4",
"scripts": {
"start": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo start",
"android": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo run:android",
@@ -82,4 +82,4 @@
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
}

View File

@@ -208,9 +208,31 @@ export class API {
}
async getResources(signal?: AbortSignal): Promise<ApiSite[]> {
const url = `/api/search/resources`;
const url = `/api/admin/config`;
const response = await this._fetch(url, { signal });
return response.json();
const config = await response.json();
// 添加安全检查
if (!config || !config.Config.SourceConfig) {
console.warn('API response missing SourceConfig:', config);
return [];
}
// 确保 SourceConfig 是数组
if (!Array.isArray(config.Config.SourceConfig)) {
console.warn('SourceConfig is not an array:', config.Config.SourceConfig);
return [];
}
// 过滤并验证每个站点配置
return config.Config.SourceConfig
.filter((site: any) => site && !site.disabled)
.map((site: any) => ({
key: site.key || '',
api: site.api || '',
name: site.name || '',
detail: site.detail
}));
}
async getVideoDetail(source: string, id: string): Promise<VideoDetail> {