|
29 | 29 | import run.ikaros.api.store.enums.AttachmentType; |
30 | 30 | import run.ikaros.plugin.alist.AListConst.ConfigMapKey; |
31 | 31 |
|
32 | | -import java.net.URLEncoder; |
33 | | -import java.nio.charset.StandardCharsets; |
34 | 32 | import java.time.Duration; |
35 | 33 | import java.time.LocalDateTime; |
36 | 34 | import java.util.*; |
@@ -92,12 +90,7 @@ private Mono<Void> createAttachmentRecursively(List<String> paths, Long parentId |
92 | 90 | }) |
93 | 91 | .flatMap(aListAttachment -> { |
94 | 92 | String path = getPathByPathArr(aListAttachment.getPaths()); |
95 | | - AListAttachment att = fetchAttachmentDetail(path, aListAttachment); |
96 | | - String name = path.substring(path.lastIndexOf('/') + 1); |
97 | | - att.setRaw_url(token.getUrl() |
98 | | - + "/d" + path.replace(name, URLEncoder.encode(name, StandardCharsets.UTF_8).replace("+", "%20")) |
99 | | - + (StringUtils.isNotBlank(att.getSign()) ? "?sign=" + att.getSign() : "")); |
100 | | - return Mono.just(att); |
| 93 | + return Mono.just(fetchAttachmentDetail(path, aListAttachment)); |
101 | 94 | }) |
102 | 95 | .flatMap(this::saveAListAttachment) |
103 | 96 | .flatMap(aListAttachment -> { |
@@ -316,11 +309,7 @@ public AListToken cm2token(ConfigMap cm) { |
316 | 309 | if (cmd == null) { |
317 | 310 | cmd = new HashMap<>(); |
318 | 311 | } |
319 | | - String url = cmd.get(ConfigMapKey.apiBaseUrl); |
320 | | - if (url.endsWith("/")) { |
321 | | - url = url.substring(0, url.length() - 1); |
322 | | - } |
323 | | - token.setUrl(url); |
| 312 | + token.setUrl(cmd.get(ConfigMapKey.apiBaseUrl)); |
324 | 313 | token.setUsername(cmd.get(ConfigMapKey.apiUsername)); |
325 | 314 | token.setPassword(cmd.get(ConfigMapKey.apiPassword)); |
326 | 315 | token.setEnableAutoTokenRefresh( |
|
0 commit comments