mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-22 02:24:44 +08:00
feat: save play record using localstorage
This commit is contained in:
@@ -8,11 +8,23 @@ export interface ApiSite {
|
||||
detail?: string;
|
||||
}
|
||||
|
||||
export interface StorageConfig {
|
||||
type: 'localstorage' | 'database';
|
||||
database?: {
|
||||
host?: string;
|
||||
port?: number;
|
||||
username?: string;
|
||||
password?: string;
|
||||
database?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
cache_time?: number;
|
||||
api_site: {
|
||||
[key: string]: ApiSite;
|
||||
};
|
||||
storage?: StorageConfig;
|
||||
}
|
||||
|
||||
export const API_CONFIG = {
|
||||
@@ -62,3 +74,8 @@ export function getApiSites(): ApiSite[] {
|
||||
key,
|
||||
}));
|
||||
}
|
||||
|
||||
export function getStorageConfig(): StorageConfig {
|
||||
const config = getConfig();
|
||||
return config.storage || { type: 'localstorage' };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user