Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

SISIS: covers are downloaded irrespective of preference settings #601

Open
StefRe opened this issue Nov 2, 2020 · 2 comments
Open

SISIS: covers are downloaded irrespective of preference settings #601

StefRe opened this issue Nov 2, 2020 · 2 comments
Labels

Comments

@StefRe
Copy link
Contributor

StefRe commented Nov 2, 2020

Download of cover images for SISIS (maybe for others too, didn't check it) is carried out in libopac (in parse_search and in loadDetail) without (of course) honoring the app's setting on_data_load_covers, i.e. cover images are downloaded even if on_data_load_covers is set to false and you're on mobile data. The reason seems to be that you must download the image as long as the session token has not yet expired. Or maybe this just emerged historically as the option was added much later (8ae23c8) and it wasn't noticed at this point that the download may be performed by libopac itself.

@raphaelm
Copy link
Member

raphaelm commented Nov 2, 2020

On the run, but as a quick data point: The reasoning was the session token back then, yes.

@johan12345 johan12345 added the bug label Nov 2, 2020
@johan12345
Copy link
Collaborator

Indeed, this is because of the session token. I think the only other API where this is needed is OPEN, where covers sometimes need to be accessed using a POST request. We also recently introduced this for covers in the account view, as it is needed by OPEN (ca4b725).

Yes, we should respect the option in this case as well. Probably there should be an additional function defined in OpacApi (e.g. setCoverBitmapsEnabled) and implemented in BaseApi which the app then uses after constructing a new API instance. Then, this can be checked anywhere where setCoverBitmap or downloadCover are used, before trying to download the image.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants