[Userscript] Search Sorting Fixer [0.4.10]

stsyn
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Twinkling Balloon - Took part in the 2021 community collab.
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Best Artist - Providing quality, Derpibooru-exclusive artwork
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Economist -
Cool Crow - "Caw!" An awesome tagger

Moderator
Well, as most of all knows, if we search for something with sorting which isn’t default id sorting, we will have a something strange, when trying to navigate previous/next between pictures.
 
Demo video
 
So, I wrote a small userscript which fixes that. Here. You need Greasemonkey or Tampermonkey to use.
 
It’s STRONGLY recommended to disable Fix buttons on start option if it’s enabled! (because it makes more requests than recommended way. You still may use it, but right now it’s provided “As Is” and may be broken)
 
Settings may be with YourBooru:Settings (direct link). Since 0.3.13 YDB:Settings is included, so you don’t need to install second userscript manualy.
 
Note, that script sorts images in a little different way than site does, it may lead to differences between site’s search responses and navigation in vague cases (e.g. equal scores).
 
 
How scripts interacts with navigation in different sortings:  
*. Score-like (score, faves, upvotes, downvotes, wilson) — does almost the same, but in a bit different way (“edge-cases” are different and tries to avoid overlapping by your own real-time voting).
*. Relevance — default derpi navigation (broken, awaiting fix on Philomena).
*. Galleries — a bit slow, but works.
*. Random — can be selected between “true” random (next/prev imitates “random” button) and “keep random seed” (slow, but navigation is more consistent).
 
Since 0.2 script also fixes ‘find’ button: you will find an image in your current query with current sorting. You may disable some in settings as well.  
*. Score-like (score, faves, upvotes, downvotes, wilson), comments, width, height, upload date, first post date — works as intended.
*. Galleries, Random with “keep seed” — works as intended, but can be slow.
*. Relevance — fallbacking to default sorting (broken, awaiting fix on Philomena).
*. Random without “keep seed” — fallbacking to default sorting.
*. Tag count, modification date — fallbacking to default sorting as could be too slow to actually work.
 
Small UI tweaks described here.
 
And that’s all.
 
There is no screenshots, because userscript doesn’t change UI at all because. Look at video.
stsyn
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Twinkling Balloon - Took part in the 2021 community collab.
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Best Artist - Providing quality, Derpibooru-exclusive artwork
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Economist -
Cool Crow - "Caw!" An awesome tagger

Moderator
Probably, there is a final version of the script.  
*. Fixed random sorting and random button queries;  
*. Added blinking when link is generated.
stsyn
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Twinkling Balloon - Took part in the 2021 community collab.
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Best Artist - Providing quality, Derpibooru-exclusive artwork
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Economist -
Cool Crow - "Caw!" An awesome tagger

Moderator
0.2  
  • navigation may be patched when clicking on the links, not when page loaded (see the first post for details);  
  • find button may be ‘fixed’ too.
     
    About find. Let’s imagine, that we viewing that image, while looking for safe not animated image sorted by score  
    full
     
    If we click ‘Find’ with no userscript, query will be lost  
    full
     
    But if find patching enabled (and we waited for a few seconds), query will be saved  
    full  
    That place in center is cursed
stsyn
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Twinkling Balloon - Took part in the 2021 community collab.
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Best Artist - Providing quality, Derpibooru-exclusive artwork
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Economist -
Cool Crow - "Caw!" An awesome tagger

Moderator
I added one small ^ button around top search field. I still didn’t explain, what exactly it does:  
full  
That one
 
First of all, if you hover search bar you will notice that dropdown menus. It’s affects at vanilla search too, you may search by score without opening separate search page.  
full
 
Before we use that ^ button, there is also one thing at tags.  
full
 
Set query option replaces value in search bar with tag value. [+] appends tag value to the end.
 
Clicking Set query under Rainbow dash tag and [+] under safe leads to this.  
full
 
We browsed that image. After we clicked ^, image is still the same, but with different search value, and now we will navigate through different stream of pictures. Or we may try to find a position of image in different case.
stsyn
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Twinkling Balloon - Took part in the 2021 community collab.
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Best Artist - Providing quality, Derpibooru-exclusive artwork
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Economist -
Cool Crow - "Caw!" An awesome tagger

Moderator
Since today (probably) Derpibooru shouldn’t lag with navigation anymore. You may turn this part off in userscript settings, since vanilla work faster.
stsyn
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Twinkling Balloon - Took part in the 2021 community collab.
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Best Artist - Providing quality, Derpibooru-exclusive artwork
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Economist -
Cool Crow - "Caw!" An awesome tagger

Moderator
Implemented navigation for “first_seen_at” sorting. It should be enabled by default, if not, visit settings.
stsyn
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Twinkling Balloon - Took part in the 2021 community collab.
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Best Artist - Providing quality, Derpibooru-exclusive artwork
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Economist -
Cool Crow - "Caw!" An awesome tagger

Moderator
I believed I will disable it with Philomena rolling, but reality is…
 
0.5.0  
— updating to the new API — now requires YDB:Settings 0.9.34 to use API key, since it’s now required;  
— added many missing sortings in dropdowns and as find image position options;  
— random can be navigated while keeping desired seed (going back and forth will have predictable results);  
— outdated and actually working by itself stuff disabled;  
— internal refactoring.
Interested in advertising on Derpibooru? Click here for information!
Techy Cutie Pony Collection!

Help fund the $15 daily operational cost of Derpibooru - support us financially!

Syntax quick reference: **bold** *italic* ||hide text|| `code` __underline__ ~~strike~~ ^sup^ %sub%

Detailed syntax guide