@@ -40,8 +40,8 @@ func initSettings() {
4040 for i := range initialSettingItems {
4141 item := & initialSettingItems [i ]
4242 item .Index = uint (i )
43- if item .PreDefault == "" {
44- item .PreDefault = item .Value
43+ if len ( item .MigrationValue ) == 0 {
44+ item .MigrationValue = item .Value
4545 }
4646 // err
4747 stored , ok := settingMap [item .Key ]
@@ -52,7 +52,7 @@ func initSettings() {
5252 continue
5353 }
5454 }
55- if stored != nil && item .Key != conf .VERSION && stored .Value != item .PreDefault {
55+ if stored != nil && item .Key != conf .VERSION && stored .Value != item .MigrationValue {
5656 item .Value = stored .Value
5757 }
5858 _ , err = op .HandleSettingItemHook (item )
@@ -147,15 +147,15 @@ func InitialSettings() []model.SettingItem {
147147 // global settings
148148 {Key : conf .HideFiles , Value : "/\\ /README.md/i" , Type : conf .TypeText , Group : model .GLOBAL },
149149 {Key : "package_download" , Value : "true" , Type : conf .TypeBool , Group : model .GLOBAL },
150- {Key : conf .CustomizeHead , PreDefault : `<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=String.prototype.replaceAll"></script>` , Type : conf .TypeText , Group : model .GLOBAL , Flag : model .PRIVATE },
150+ {Key : conf .CustomizeHead , MigrationValue : `<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=String.prototype.replaceAll"></script>` , Type : conf .TypeText , Group : model .GLOBAL , Flag : model .PRIVATE },
151151 {Key : conf .CustomizeBody , Type : conf .TypeText , Group : model .GLOBAL , Flag : model .PRIVATE },
152152 {Key : conf .LinkExpiration , Value : "0" , Type : conf .TypeNumber , Group : model .GLOBAL , Flag : model .PRIVATE },
153153 {Key : conf .SignAll , Value : "true" , Type : conf .TypeBool , Group : model .GLOBAL , Flag : model .PRIVATE },
154154 {Key : conf .PrivacyRegs , Value : `(?:(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])
155155([[:xdigit:]]{1,4}(?::[[:xdigit:]]{1,4}){7}|::|:(?::[[:xdigit:]]{1,4}){1,6}|[[:xdigit:]]{1,4}:(?::[[:xdigit:]]{1,4}){1,5}|(?:[[:xdigit:]]{1,4}:){2}(?::[[:xdigit:]]{1,4}){1,4}|(?:[[:xdigit:]]{1,4}:){3}(?::[[:xdigit:]]{1,4}){1,3}|(?:[[:xdigit:]]{1,4}:){4}(?::[[:xdigit:]]{1,4}){1,2}|(?:[[:xdigit:]]{1,4}:){5}:[[:xdigit:]]{1,4}|(?:[[:xdigit:]]{1,4}:){1,6}:)
156156(?U)access_token=(.*)&` ,
157157 Type : conf .TypeText , Group : model .GLOBAL , Flag : model .PRIVATE },
158- {Key : conf .OcrApi , Value : "https://api.example.com/ocr/file/json" , Type : conf .TypeString , Group : model .GLOBAL }, // TODO: This can be replace by a community-hosted endpoint, see https://github.com/OpenListTeam/ocr_api_server
158+ {Key : conf .OcrApi , Value : "https://openlistteam-ocr-api-server.hf.space/ocr/file/json" , MigrationValue : "https:// api.example.com/ocr/file/json" , Type : conf .TypeString , Group : model .GLOBAL }, // TODO: This can be replace by a community-hosted endpoint, see https://github.com/OpenListTeam/ocr_api_server
159159 {Key : conf .FilenameCharMapping , Value : `{"/": "|"}` , Type : conf .TypeText , Group : model .GLOBAL },
160160 {Key : conf .ForwardDirectLinkParams , Value : "false" , Type : conf .TypeBool , Group : model .GLOBAL },
161161 {Key : conf .IgnoreDirectLinkParams , Value : "sign,openlist_ts" , Type : conf .TypeString , Group : model .GLOBAL },
0 commit comments