Danbooru

[Request] Visited Posts History

Posted under Bugs & Features

This is probably a long shot, but couldn't hurt to ask. You know how visited links change color in a page? It would be wonderful if that applied to Danbooru somehow, because thumbnails don't change color after you've visited the post. In Pixiv, pics have a title, and the title becomes gray after you've visited the post. Maybe there could be an option to display something like "post #10000" below the thumbnail that would behave that way? It doesn't even need to be a Danbooru feature, if someone knows a script somewhere that would do that for me, I'll take it. I tried making the browser not load images to see what would happen, but the text doesn't change color.

Why do I need this? Because I'm a huge pack rat. Everything I see that I like, I download. It can get very hard to keep track of what I have seen (read: downloaded) and what I haven't yet, because the only way I could possibly be sure is to check pic by pic and write down that artist as "done up to post ####" in a text file somewhere. Even then, sometimes an old pic may not have an artist, but someone figures out that it was done by that artist I already marked as "done" and tags it as such. So now there's a pic somewhere in the middle that I have not yet seen/downloaded, and I probably never will. The only other way is favorites; if I favorited something, I downloaded it. But there are also many pics that I download but don't favorite.

Before going the script or CSS route, or even adding a new feature to baseline Danbooru, why not take a look at favorite groups (Help:Favorite Groups). They're like favorites, except without the same degree of public visibility, and they behave more like pools so you can rename them and order them however you like. As a Platinum+ user, You can have up to 10 favorite groups, with 10000 images in each. Just start a Downloaded 1 favgroup. When that gets full, start a Downloaded 2 favgroup, and so on, and so forth.

With assistance from BrokenEagle, I came up with some CSS to indicate unvisited/visited posts:

EDIT: Old version:

div:not(#has-children-relationship-preview):not(#has-parent-relationship-preview) > article.post-preview,
td > article.post-preview, #c-pools article.post-preview, #posts>div {
    overflow: visible;
}

a:link>img[itemprop="thumbnailUrl"] {
    outline: 3px solid #FFF;
}

a:visited>img[itemprop="thumbnailUrl"] {
    outline-color: pink;
}

New version:

div:not(#has-children-relationship-preview):not(#has-parent-relationship-preview) > article.post-preview,
td > article.post-preview, #c-pools article.post-preview, #posts>div {
    overflow: visible;
}

a:link>picture>img[itemprop="thumbnailUrl"] {
    outline: 3px solid #FFF;
}

a:visited>picture>img[itemprop="thumbnailUrl"] {
    outline-color: pink;
}

This adds a white outline around unvisited posts (which should be invisible with the normal danbooru background, though it will be visible in the parent/child box), and changes it to pink for visited posts. As far as I can tell, the limitations on :visited apply to child elements, so I wasn't able to just add an outline to visited posts; I had to make an outline for all of them and change the color.

Since danbooru adds your current query to the end of post URLs, a post normally won't show as visited if you're looking at a different query. BrokenEagle pointed me to his Userscript in forum #136251, which removes search parameters from the image links on the post search page. In order to also clean up parent/child links when looking at a post, I made one minor change to it (just removed the question mark in the match); all credit for the Userscript goes to BrokenEagle:

// ==UserScript==
// @name           Danbooru Post URLs (incl. parent/child)
// @match          *://*.donmai.us/posts*
// @grant          none
// @run-at         document-idle
// @description    Remove trailing search parameters from image links on the post search page and post page (for parent/child images).
// ==/UserScript==

$.each($(".post-preview a"), (i,entry)=>{
    entry.href = entry.pathname;
});

Updated

Fantastic, thank you very much.

Also, nice, I didn't know about fav groups. They wouldn't exactly be ideal for what I wanted, but they will help a lot.
Out of curiosity, is there a reason why there's a limit of 10 groups / 100k pics, even on the highest user level? Isn't it just text?

Mordon said:

Also, nice, I didn't know about fav groups. They wouldn't exactly be ideal for what I wanted, but they will help a lot.
Out of curiosity, is there a reason why there's a limit of 10 groups / 100k pics, even on the highest user level? Isn't it just text?

There were some concerns about performance characteristics (issue #635), and @albert mentioned something about worrying about the table blowing up (issue #2416). I'm not sure either has been readdressed though since the creation of favorite groups.

I would welcome more of either favgroup numbers or favgroup size, as I currently have maxed out my 10 favgroup limit, and one of my favgroups was too small for something I wanted to demonstrate (favgroup #2573 in forum #141533) so I had to truncate what I wanted to show.

Laethiel said:

// ==UserScript==
// @name           Danbooru Post URLs (incl. parent/child)
// @match          *://*.donmai.us/posts*
// @grant          none
// @run-at         document-idle
// @description    Remove trailing search parameters from image links on the post search page and post page (for parent/child images).
// ==/UserScript==

$.each($(".post-preview a"), (i,entry)=>{
    entry.href = entry.pathname;
});

can someone make a clickable link to install? i am having trouble manually installing this

if someone could through it up on their github that would just be primo

1