keiyoushi / extensions-source

Source code of extensions for Tachiyomi/Mihon and variants.
https://keiyoushi.github.io/
Apache License 2.0
1.51k stars 351 forks source link

Anchira: unable to fetch thumbnails #2407

Closed MediocreLegion closed 1 month ago

MediocreLegion commented 1 month ago

Source information

Anchira 1.4.11

Source language

English

Steps to reproduce

Open any anchira title and update the metadata

Expected behavior

Thumbnails are properly fetched

Actual behavior

No thumbnails are shown

Screenshot_2024-04-14-00-03-19-802_eu kanade tachiyomi j2k

Mihon/Tachiyomi version

TachiyomiJ2K 1.7.4

Android version

Android 12

Other details

No response

Acknowledgements

BrutuZ commented 1 month ago

Can't repro image

MediocreLegion commented 1 month ago

@BrutuZ If you already have the thumbnails on cache, it doesn't happen. You need to open any title and refetch the metadata for it to happen with these titles.

BrutuZ commented 1 month ago

Caching shouldn't be an issue here, I literally installed J2K for the first time ever to test this and #2408

MediocreLegion commented 1 month ago

Are logged into Anchira? I'm not using an account

BrutuZ commented 1 month ago

No. Installed J2K > Trusted previously installed extension > opened Browse > Screenshot

MediocreLegion commented 1 month ago

Weird that it works for you. Tho, I suspected it was happening because of the default thumb_index being 1 instead of 0 here: https://github.com/keiyoushi/extensions-source/blob/5108353ff986848501d404ba83e2f06bb6d94834/src/en/anchira/src/eu/kanade/tachiyomi/extension/en/anchira/AnchiraDto.kt#L26 combined with this +1 in the code: https://github.com/keiyoushi/extensions-source/blob/5108353ff986848501d404ba83e2f06bb6d94834/src/en/anchira/src/eu/kanade/tachiyomi/extension/en/anchira/Anchira.kt#L241-L242 This would affect titles that don't have a thumb_index field in the api response (that happens with titles in which the first page is the thumbnail), so the extension would try to fetch the second page instead of the first.

MediocreLegion commented 1 month ago

I'll reinstall anyway to confirm Nope it didn't work

MediocreLegion commented 1 month ago

@BrutuZ Having tested the cdnUrl endpoints, I'm pretty sure the issue is indeed the default value being 1 instead of 0 for the titles without thumb_index in the api response.

BrutuZ commented 1 month ago

I just realized I already had that DTO change in my local build since 3 days ago when I first saw an entry without the thumb_index field. So yeah, you're absolutely right, reversed it just now to double-check and sure enough shit broke much like yours.

2448 fixes it though