Skip to content

Commit

Permalink
修复上传alist时未及时重命名的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuo894 committed Nov 18, 2024
1 parent 94a9cb9 commit b9c6e05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/main/java/ani/rss/download/Transmission.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,18 @@ public void rename(TorrentsInfo torrentsInfo) {
EhCacheUtil.remove(id);

for (int i = 0; i < 10; i++) {
ThreadUtil.sleep(500);
ThreadUtil.sleep(1000);
Optional<TorrentsInfo> first = getTorrentsInfos().stream()
.filter(info -> info.getId().equals(id))
.findFirst();
if (first.isEmpty()) {
break;
}
if (first.get().getName().equals(reName)) {
break;
return;
}
}
log.warn("重命名貌似出现了问题?{}", reName);
}

@Override
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/ani/rss/download/qBittorrent.java
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,13 @@ public void rename(TorrentsInfo torrentsInfo) {

// qb重命名具有延迟,等待重命名完成
for (int i = 0; i < 10; i++) {
ThreadUtil.sleep(500);
ThreadUtil.sleep(1000);
names = torrentsInfo.getFiles().get();
if (new HashSet<>(names).containsAll(newNames)) {
break;
return;
}
}
log.warn("重命名貌似出现了问题?{}", reName);
}

@Override
Expand Down

0 comments on commit b9c6e05

Please sign in to comment.