Here’s the https://perchance.org/prompt-hunter , a gallery tag searching gen.

    if (formatTagName !== "no filter, currently showing all tags" && dataMatch) {
  
      // Modify the 'bannedPromptPhrases' array
      dataObj.bannedPromptPhrases = [`/^(?!.*(\\b${formatTagName}\\b)).*$/i`];
      localStorage.setItem("lookForThis", formatTagName);

    } else {
      localStorage.removeItem("lookForThis");
    }

    if (formatBadTags !== "no bad words to filter") {
      dataObj.bannedPromptPhrases.push(...formatBadTags);
      let badTagsJoin = formatBadTags.join(', ')
      localStorage.setItem("dontLookForThis", badTagsJoin);
      
    } else {
      localStorage.removeItem("dontLookForThis")
    }

I want to add my own banned list [jail.bannedPromptPhrases] and import jail, added after that as

      if (Array.isArray(jail?.bannedPromptPhrases)) {
        dataObj.bannedPromptPhrases.push(...jail.bannedPromptPhrases);
      }
    }

Now the problem is that’s giving unstable results, sometimes it works and sometimes not. I have no idea how or why. In this forked gen https://perchance.org/prompt-hunter#sharedlink=gen%3Aai-furry-generator&galleryname%3Atest3=&tag%3A=&bannedword=: Apple should be banned in PG-13 because it has a PG-13 banned tag “ContentLabel”. But sometimes it just won’t work!(what’s tricky is sometimes it also work) Help!

  • BlackYT@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    I dont know if this is really the problem because i was testing using my own pics, but i forgot that i can still see my pics when they are banned if i am with admin mode disabled. But make sure your list is an array:

    let furryJail = jail.bannedPromptPhrases.selectAll.join(','); furryJail .split(",") .map(tag => tag.trim()) .filter(tag => tag !== "") ; dataObj.bannedPromptPhrases.push(...furryJail);

    like

    also you need to add it in 2 functions, changeAll() and changeGallerySubChannel() so it runs at the start.