use of me.devsaki.hentoid.util.download.RequestOrder in project Hentoid by avluis.
the class ContentDownloadWorker method buildImageDownloadRequest.
private RequestOrder buildImageDownloadRequest(@NonNull final ImageFile img, @NonNull final DocumentFile dir, @NonNull final Content content) {
Site site = content.getSite();
String imageUrl = HttpHelper.fixUrl(img.getUrl(), site.getUrl());
// Apply image download parameters
Map<String, String> requestHeaders = getRequestHeaders(imageUrl, img.getDownloadParams());
final String backupUrlFinal = HttpHelper.fixUrl(img.getBackupUrl(), site.getUrl());
return new RequestOrder(Request.Method.GET, imageUrl, requestHeaders, site.useHentoidAgent(), site.useWebviewAgent(), result -> onImageRequestSuccess(result, img, dir, backupUrlFinal, requestHeaders), error -> onRequestError(error, content, img, dir, backupUrlFinal, requestHeaders));
}
Aggregations