Happy Birthday, MLP:FiM! MLP:FiM turns 10 years old this year! Let's celebrate with an art event!

[Userscript] Search Sorting Fixer [0.4.10]

stsyn
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
The Power of Love - Given to a publicly verified artist with an image under their artist’s tag that has reached 1000 upvotes
Equality - In our state, we do not stand out.
Magnificent Metadata Maniac -
Birthday Cake - Celebrated MLP's 7th birthday
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Artist -

Site 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
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
The Power of Love - Given to a publicly verified artist with an image under their artist’s tag that has reached 1000 upvotes
Equality - In our state, we do not stand out.
Magnificent Metadata Maniac -
Birthday Cake - Celebrated MLP's 7th birthday
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Artist -

Site Moderator
Probably, there is a final version of the script.
*. Fixed random sorting and random button queries;
*. Added blinking when link is generated.
stsyn
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
The Power of Love - Given to a publicly verified artist with an image under their artist’s tag that has reached 1000 upvotes
Equality - In our state, we do not stand out.
Magnificent Metadata Maniac -
Birthday Cake - Celebrated MLP's 7th birthday
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Artist -

Site 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


If we click 'Find' with no userscript, query will be lost


But if find patching enabled (and we waited for a few seconds), query will be saved

That place in center is cursed
stsyn
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
The Power of Love - Given to a publicly verified artist with an image under their artist’s tag that has reached 1000 upvotes
Equality - In our state, we do not stand out.
Magnificent Metadata Maniac -
Birthday Cake - Celebrated MLP's 7th birthday
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Artist -

Site Moderator
I added one small ^ button around top search field. I still didn't explain, what exactly it does:

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.


Before we use that ^ button, there is also one thing at tags.


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.


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
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
The Power of Love - Given to a publicly verified artist with an image under their artist’s tag that has reached 1000 upvotes
Equality - In our state, we do not stand out.
Magnificent Metadata Maniac -
Birthday Cake - Celebrated MLP's 7th birthday
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Artist -

Site 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
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
The Power of Love - Given to a publicly verified artist with an image under their artist’s tag that has reached 1000 upvotes
Equality - In our state, we do not stand out.
Magnificent Metadata Maniac -
Birthday Cake - Celebrated MLP's 7th birthday
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Artist -

Site Moderator
Implemented navigation for "first_seen_at" sorting. It should be enabled by default, if not, visit settings.
stsyn
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
The Power of Love - Given to a publicly verified artist with an image under their artist’s tag that has reached 1000 upvotes
Equality - In our state, we do not stand out.
Magnificent Metadata Maniac -
Birthday Cake - Celebrated MLP's 7th birthday
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Artist -

Site 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!
Lunarshine Plush market!

Derpibooru costs over $25 a day to operate - help support us financially!

Syntax quick reference: *bold* _italic_ [spoiler]hide text[/spoiler] @code@ +underline+ -strike- ^sup^ ~sub~