Faithful-Resource-Pack / API

A public API for Faithful Resource Pack textures, add-ons and more
https://api.faithfulpack.net
GNU Affero General Public License v3.0
0 stars 0 forks source link

Experimental: Gallery search #16

Closed TheRolfFR closed 2 years ago

TheRolfFR commented 2 years ago

Experimental code to replace Gallery search wizardry made on the client-side with the same displayed format and improved search algorithm:

image

Improvements

versions_featured field contains the other versions for the matching path. A wider request including other paths could allow all versions featured in the texture use to be featured.

For the moment, we use res as the displayed texture. This is translated in the service as a pack name. We could change that too to take as the first argument the pack name.

Benchmarks

All results are coming after 3.5s in a remote connection: image

And results with search makes the request a little faster: image

If production is using "local" URLs it could go much faster.

There is always room for improvement, and we can develop this PR as you wish.

Pomi108 commented 2 years ago

how am i supposed to review this? this is too code-y for me x)

TheRolfFR commented 2 years ago

how am I supposed to review this? this is too code-y for me x)

@Pomi108 I wasn't expecting you to review the code, I wanted to know if the versions_featured field would solve the https://github.com/Faithful-Resource-Pack/App/issues/76 issue at the same time ? Would you like all versions of this texture or all of the versions of the path we found?

Pomi108 commented 2 years ago

I see does the versions_featured field list all versions the texture is present in? I mean including the one you're searching for

TheRolfFR commented 2 years ago

Unfortunately it only gives the ones matching the version you looked for. i didn't want all versions else it would be huge but we can change that.

Pomi108 commented 2 years ago

If that's the case then we don't need to include that at all. Displaying all of the versions was the whole point of App#76

TheRolfFR commented 2 years ago

If that's the case then we don't need to include that at all. Displaying all of the versions was the whole point of App#76

So @Pomi108 we delete versions_featured and we don't do App#76 ?

Pomi108 commented 2 years ago

Yeah, for now. It'd still be nice to add what I suggested sometime in the future though.

Juknum commented 2 years ago

Did this PR can be merged ? @TheRolfFR

TheRolfFR commented 2 years ago

I may have to remove the versions_featured field but else yes