Search in sources :

Example 1 with RequestOrder

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));
}
Also used : Site(me.devsaki.hentoid.enums.Site) RequestOrder(me.devsaki.hentoid.util.download.RequestOrder)

Aggregations

Site (me.devsaki.hentoid.enums.Site)1 RequestOrder (me.devsaki.hentoid.util.download.RequestOrder)1