From 3d32fd7bccf1c4c317bc962e9a624455c148a603 Mon Sep 17 00:00:00 2001 From: seven332 Date: Wed, 1 Apr 2015 09:22:12 +0800 Subject: [PATCH] Fix omitted 509 url --- .../com/hippo/ehviewer/ehclient/ExDownloader.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/ehclient/ExDownloader.java b/app/src/main/java/com/hippo/ehviewer/ehclient/ExDownloader.java index a74e5aaba..02cce170b 100644 --- a/app/src/main/java/com/hippo/ehviewer/ehclient/ExDownloader.java +++ b/app/src/main/java/com/hippo/ehviewer/ehclient/ExDownloader.java @@ -51,11 +51,9 @@ public final class ExDownloader implements Runnable { private static final int IO_BUFFER_SIZE = 8 * 1024; - private static final String[] URL_ARRAY_509 = new String[] { - "http://ehgt.org/g/509.gif", - "http://ehgt.org/g/509s.gif", - "http://st.exhentai.net/img/509.gif", - "http://st.exhentai.net/img/509s.gif" + private static final String[] URL_509_SUFFIX_ARRAY = { + "/509.gif", + "/509s.gif" }; private final Context mContext; @@ -786,9 +784,8 @@ public final class ExDownloader implements Runnable { //Check 509 gif boolean get509 = false; - int length = URL_ARRAY_509.length; - for (int j = 0; j < length; j++) { - if (URL_ARRAY_509[j].equals(imageUrl)) { + for (String suffix : URL_509_SUFFIX_ARRAY) { + if (imageUrl.endsWith(suffix)) { // Get 509 gif here get509 = true; break;