Skip to content

Commit

Permalink
Revert "更新aList的url为/d/{path}(?sign={sign})"
Browse files Browse the repository at this point in the history
This reverts commit 9322e73.
  • Loading branch information
chivehao committed Sep 16, 2024
1 parent 7bfa834 commit 7981532
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# 15.2.0

- 更新aList的url为/d/{path}(?sign={sign})


# v0.12.11

Expand Down
15 changes: 2 additions & 13 deletions src/main/java/run/ikaros/plugin/alist/AListClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import run.ikaros.api.store.enums.AttachmentType;
import run.ikaros.plugin.alist.AListConst.ConfigMapKey;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.*;
Expand Down Expand Up @@ -92,12 +90,7 @@ private Mono<Void> createAttachmentRecursively(List<String> paths, Long parentId
})
.flatMap(aListAttachment -> {
String path = getPathByPathArr(aListAttachment.getPaths());
AListAttachment att = fetchAttachmentDetail(path, aListAttachment);
String name = path.substring(path.lastIndexOf('/') + 1);
att.setRaw_url(token.getUrl()
+ "/d" + path.replace(name, URLEncoder.encode(name, StandardCharsets.UTF_8).replace("+", "%20"))
+ (StringUtils.isNotBlank(att.getSign()) ? "?sign=" + att.getSign() : ""));
return Mono.just(att);
return Mono.just(fetchAttachmentDetail(path, aListAttachment));
})
.flatMap(this::saveAListAttachment)
.flatMap(aListAttachment -> {
Expand Down Expand Up @@ -316,11 +309,7 @@ public AListToken cm2token(ConfigMap cm) {
if (cmd == null) {
cmd = new HashMap<>();
}
String url = cmd.get(ConfigMapKey.apiBaseUrl);
if (url.endsWith("/")) {
url = url.substring(0, url.length() - 1);
}
token.setUrl(url);
token.setUrl(cmd.get(ConfigMapKey.apiBaseUrl));
token.setUsername(cmd.get(ConfigMapKey.apiUsername));
token.setPassword(cmd.get(ConfigMapKey.apiPassword));
token.setEnableAutoTokenRefresh(
Expand Down

0 comments on commit 7981532

Please sign in to comment.