Skip to content

Commit

Permalink
v1.0.1修复图片重复保存问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayaoO3O committed Feb 18, 2021
1 parent 8916791 commit ea298bc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/vip/comic18/finder/service/ComicService.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ public void downloadComic(ComicEntity comicEntity) throws ExecutionException, In
BufferedImage image = taskService.getImage(photo.getUrl()).get();
image = taskService.reverseImage(image).get();
taskService.saveImage(chapterDir.getPath() + File.separatorChar + photo.getName(), image);
} else {
taskService.saveImage(photo.getUrl(), photoFile);
}
taskService.saveImage(photo.getUrl(), photoFile);
}
}
}
Expand All @@ -74,10 +75,10 @@ public void downloadComic(ComicEntity comicEntity) throws ExecutionException, In
*/
public ComicEntity getComicInfo(String comicHomePage) throws ExecutionException, InterruptedException {
ComicEntity comicEntity = new ComicEntity();
HttpResponse httpResponse = null ;
if(StrUtil.contains(comicHomePage,"photo")) {
httpResponse = taskService.createPost(StrUtil.replace(comicHomePage,"photo","album")).setFollowRedirects(true).execute();
}else {
HttpResponse httpResponse = null;
if(StrUtil.contains(comicHomePage, "photo")) {
httpResponse = taskService.createPost(StrUtil.replace(comicHomePage, "photo", "album")).setFollowRedirects(true).execute();
} else {
httpResponse = taskService.createPost(comicHomePage).execute();
}
String body = httpResponse.body();
Expand Down

0 comments on commit ea298bc

Please sign in to comment.