MCPcopy
hub / github.com/hmjz100/LinkSwift / initDefaultConfig

Function initDefaultConfig

(改)网盘直链下载助手.user.js:2002–2158  ·  view source on GitHub ↗

* 初始化默认配置 * @author 油小猴 * @author hmjz100 * @description 创建基础配置、主题设置等存储项(仅当不存在时)

()

Source from the content-addressed store, hash-verified

2000 * @description 创建基础配置、主题设置等存储项(仅当不存在时)
2001 */
2002 initDefaultConfig() {
2003 if (base.getValue("setting_config_version") !== "1") base.initConfigMigration(1);
2004 // 设置新结构的默认值(仅当未设置时)
2005 let defaults = [
2006 {
2007 name: "setting_idm_rpc",
2008 value: [
2009 {
2010 id: "1",
2011 default: true
2012 }
2013 ]
2014 },
2015 {
2016 name: "setting_aria2_rpc",
2017 value: [
2018 {
2019 domain: "http://localhost",
2020 port: "16800",
2021 path: "/jsonrpc",
2022 token: "",
2023 dir: "",
2024 default: true
2025 }
2026 ]
2027 },
2028 {
2029 name: "setting_bitcomet_rpc",
2030 value: [
2031 {
2032 domain: "http://localhost",
2033 port: "8080",
2034 path: "/panel/task_add_httpftp_result",
2035 authName: "",
2036 authPass: "",
2037 dir: "",
2038 default: true
2039 }
2040 ]
2041 },
2042 {
2043 name: "setting_abdm_rpc",
2044 value: [
2045 {
2046 domain: "http://localhost",
2047 port: "15151",
2048 dir: "",
2049 default: true
2050 }
2051 ]
2052 },
2053 {
2054 name: "setting_curl_terminal",
2055 value: "wc"
2056 },
2057 {
2058 name: "setting_init",
2059 value: {

Callers

nothing calls this directly

Calls 2

cloneDeepFunction · 0.85
fillMissingFieldsFunction · 0.85

Tested by

no test coverage detected