Skip to content

一分钟搭建影视站,支持Docker等部署方式

feat: export necessary configs only Signed-off-by: JohnsonRan <[email protected]>

JohnsonRan5ac4522fc08e
diff --git a/js/app.js b/js/app.js
index 541f953..eef77f3 100644
--- a/js/app.js
+++ b/js/app.js
@@ -1154,12 +1154,34 @@ async function importConfig() {
async function exportConfig() {
// 存储配置数据
const config = {};
-
- // 读取全部 localStorage 项
const items = {};
- for (let i = 0; i < localStorage.length; i++) {
- const key = localStorage.key(i);
- items[key] = localStorage.getItem(key);
+
+ const settingsToExport = [
+ 'selectedAPIs',
+ 'customAPIs',
+ 'yellowFilterEnabled',
+ 'adFilteringEnabled',
+ 'doubanEnabled',
+ 'hasInitializedDefaults'
+ ];
+
+ // 导出设置项
+ settingsToExport.forEach(key => {
+ const value = localStorage.getItem(key);
+ if (value !== null) {
+ items[key] = value;
+ }
+ });
+
+ // 导出历史记录
+ const viewingHistory = localStorage.getItem('viewingHistory');
+ if (viewingHistory) {
+ items['viewingHistory'] = viewingHistory;
+ }
+
+ const searchHistory = localStorage.getItem(SEARCH_HISTORY_KEY);
+ if (searchHistory) {
+ items[SEARCH_HISTORY_KEY] = searchHistory;
}
const times = Date.now().toString();