feat: Refactor settings management into a dedicated page with new configuration options, including live stream source and remote input settings

This commit is contained in:
zimplexing
2025-07-11 17:23:36 +08:00
parent fc8da352fb
commit 03d80c42cd
14 changed files with 607 additions and 215 deletions

View File

@@ -25,10 +25,15 @@ export interface FavoriteItem {
}
export interface AppSettings {
theme: "light" | "dark" | "auto";
autoPlay: boolean;
playbackSpeed: number;
apiBaseUrl: string;
remoteInputEnabled: boolean;
videoSource: {
enabledAll: boolean;
sources: {
[key: string]: boolean;
};
},
m3uUrl: string;
}
// --- Helper ---
@@ -178,10 +183,13 @@ export class SearchHistoryManager {
export class SettingsManager {
static async get(): Promise<AppSettings> {
const defaultSettings: AppSettings = {
theme: "auto",
autoPlay: true,
playbackSpeed: 1.0,
apiBaseUrl: "",
apiBaseUrl: "https://orion-tv.edu.deal",
remoteInputEnabled: false,
videoSource: {
enabledAll: true,
sources: {},
},
m3uUrl: "https://raw.githubusercontent.com/sjnhnp/adblock/refs/heads/main/filtered_http_only_valid.m3u",
};
try {
const data = await AsyncStorage.getItem(STORAGE_KEYS.SETTINGS);