Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index file for thumbnails (do not merge yet) #17521

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zoltanvb
Copy link
Contributor

@zoltanvb zoltanvb commented Feb 5, 2025

Do not merge yet - 2 tasks need to be done and at least a few index files should be present for this to make sense.

Description

Add the function to retrieve an .index-extended file for thumbnail repositories, similar to core updater. Use the list to determine if the download should be attempted or not. For now, fall back to previous method if index can not be retrieved.

Currently, this PR would bring no immediate benefits, as there are no .index-extended files in thumbnail repos. I have opened a PR to get one: libretro-thumbnails/Sinclair_-_ZX_Spectrum#14 . Either that workflow needs to be added to all thumbnail repos (copy-paste, just a lot of it), or index files can be generated centrally, but that may take a toll on the server if it is not done smartly (i.e. changed files only). Generating a new index file for the ZX Spectrum repo takes ~40 min.

Benefits if index files are populated:

  • ondemand thumbnail downloads will typically result in one download per system (the index), instead of several failed ones. As thumbnails do not change very frequently, this may bring a benefit, depending on the current ratio of 404 requests (which I do not know, but would guess it is quite high).

There may be also drawbacks:

  • increased memory footprint
  • index file may be of significant size (2 MB for the possibly largest one)

This can also pave the way for a few improvements (not included to current code):

  • if there is no suitable thumbnail, try to apply flexible naming in a way to retrieve files from the server, that have partial match, and save them with short name, so they will get shown
  • if someone feels the power to do so, even implement "select thumbnail" menu
  • check CRCs to determine if update of existing thumbnails is needed
  • support of non-PNG thumbnails also in central repositories
  • if index files are always available, thumbnail download code can be simplified by a significant amount

TODOs in any case:

  • doublecheck working for Favorites/History
  • remove excessive logging

Add the function to retrieve an .index-extended file for thumbnail
repositories, similar to core updater. Use the list to determine
if the download should be attempted or not. For now, fall back to
previous method if index can not be retrieved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant