Topic: [Feature] Alert or warn the user if they are about to upload a post with avoid_posting or conditional_dnp

Posted under Site Bug Reports & Feature Requests

Requested feature overview description.
When entering tags, if the tag field registers key_up or unfocus, and there is a 2 second delay, query the server and check if it is a known DNP artist, example:

document.addEventListener("DOMContentLoaded", function(){
    //Original idea was to get a list of the tags by type and check
    //each artist tag for implementation to the following consequent IDs
    var consequent_conditional = 219945, consequent_avoid = 16198,
        inputField = document.getElementById("post_tags"), timer = null;
    
    function checkIfConditionalOrDNP(){
        //This isn't a valid API endpoint, and is just an example
        //Example format: {"is": integer [0|1|2], "ref": string url}
        var req = new XMLHttpRequest();
        req.open("GET", "/tags/dnptest.json", true);
        req.onload = function(e) {
            var res = JSON.parse(req.response);
            //Lets hook right on in to the e621's site code! :D
            if(res["is"]==2){
                error("WARNING: The post you are uploading contains a known avoid posting artist. Continuing with this upload may result in a record on your account! Reference: <a href=\""+res["reference"]+"\">"+res["reference"]+"</a>");
            }else if(res["is"]==1){
                warning("WARNING: The post you are uploading contains a known conditional DNP artist, please be sure that this post does not meet the citera: <a href=\""+res["reference"]+"\">"+res["reference"]+"</a>");
            }
        };
        req.send(inputField.value);
    }
    
    function createOrReplaceTimer(){
        //Clear it if it doesn't exist
        if(timer === null)
            clearTimeout(timer);
        //Create timer
        timer = setTimeout(function(){
            checkIfConditionalOrDNP();
            timer = null;
        },1000);
    }
    //Add the event hooks
    inputField.addEventListener("keyup", createOrReplaceTimer);
    inputField.addEventListener("blur", createOrReplaceTimer);
    inputField.addEventListener("paste", createOrReplaceTimer);
});

Why would it be useful?
People will not be bapped as often. It will also help those who know who the artist is but doesn't know that they are DNP, making it so they don't have to flag it after they upload and see avoid_posting was automatically added.

What part(s) of the site page(s) are affected?

  • Uploads

Updated by BlueDingo

+1. I hate having to frequently check the DNP list to make sure I'm not uploading DNP content. I also hate having to flag my own uploads just because I accidentally uploaded something I shouldn't have.

Updated by anonymous

Fairly certain e6 extend already does this. It would be a nice base feature

Updated by anonymous

GDelscribe said:
Fairly certain e6 extend already does this. It would be a nice base feature

e6 extend does do this and it's great. +1 for it being a regular site feature.

Updated by anonymous

+1 sorry if its a bit of a stupid question but what do you mean by a 2 second delay or should i say why is a delay included?

Updated by anonymous

Ruku said:
+1 sorry if its a bit of a stupid question but what do you mean by a 2 second delay or should i say why is a delay included?

No question is a stupid question in my view. Questions lead to answers and answers lead to knowledge, which makes questions great!

Script I made uses 1 second delay instead of 2, I meant the delay time as an example which could probably even be 0.75 seconds.
As for having the delay, it prevents the server from getting hammered with requests which it has to process while the user is typing.
So for example, if there was no delay, if you type "apple", it will request tag info for "a" "ap" "app" "appl" "apple", which while not optimal, network wise e621 would be able to handle, but server side it still has to check each and every tag for which type it is, and for each artist tag it has to check if it implies avoid_posting or conditional_dnp.
With the delay, it will only query "apple", unless the user has to stop and think, in which case it may query something like "app" "apple".

Updated by anonymous

Chaser said:
No question is a stupid question in my view. Questions lead to answers and answers lead to knowledge, which makes questions great!

What color are oranges?

Updated by anonymous

Would it be possible make it check upon clicking the submit button and prevent the upload from going through if a DNP artist is present?

Updated by anonymous

BlueDingo said:
Would it be possible make it check upon clicking the submit button and prevent the upload from going through if a DNP artist is present?

Yes but doing so may prevent "conditional"(listed as avoid_posting not conditional_dnp) DNPs to where the artist has given explicit permission to do so.
If a user ignores the warning then it will be on them.

Updated by anonymous

Chaser said:
No question is a stupid question in my view.

On the other hand, "no stupid questions" doesn't preclude the existence of inquisitive idiots. :P

Updated by anonymous

  • 1