Skip to content

Commit

Permalink
Prevent redownload images
Browse files Browse the repository at this point in the history
original code always tried to download images.
it increases network traffic.
  • Loading branch information
d3m3vilurr committed May 6, 2019
1 parent 1714b09 commit e8a01ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/com/pixiv/muzei/pixivsource/PixivArtWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,12 @@ private Uri downloadOriginalImage(final JsonObject content,
throw new IOException("Couldn't get cache directory");
}

// TODO: resume download or check finished download.
if (originalFile.exists()) {
Log.d(LOG_TAG, "already exists: " + originalFile.getAbsolutePath());
return Uri.parse("file://" + originalFile.getAbsolutePath());
}

Response resp = getOriginalImageResponse(content, referer);

final int status = resp.code();
Expand Down

0 comments on commit e8a01ce

Please sign in to comment.