Touhou 1M GET!

Deleting unposted images?

Posted under General

Is there any way to delete unposted images in the "My uploads" tab? I've got a lot sitting there that I'm not going to post and don't want to accidentally post (mostly duplicates). I saw there was some talk about this a few years ago and that there wasn't an option to do so. Has there been any change, is there any way to remove them now?

Knowledge_Seeker said:

Nope. Trust me, if there was, I'd have a clean unposted media tab.

I weep. Are there any plans in the works to let us do that? Or must we forever remain buried in our own refuse?

You can't delete but there is a userscript to hide assets which should help you. It was on the forums previously but was deleted.

Danbooru hide uploads
// ==UserScript==
// @name        Danbooru hide uploads
// @match       *://*.donmai.us/uploads
// @match       *://*.donmai.us/uploads?*
// @match       *://*.donmai.us/users/*/uploads
// @match       *://*.donmai.us/users/*/uploads?*
// @grant       GM_addStyle
// @grant       GM_setValue
// @grant       GM_getValue
// @grant       GM_deleteValue
// @version     0.1.3
// @author      Nameless Contributor
// @description Provides a way to hide specific uploads from the overview.
// ==/UserScript==

'use strict';

GM_addStyle(`
.dhu-hide .dhu-hidden {
  display: none;
}

#dhu-toggle {
  color: var(--muted-text-color);
  padding: .25rem;
}

#dhu-toggle label {
  font-size: var(--text-sm);
}

.dhu-button {
  color: var(--preview-icon-color);
  background: var(--preview-icon-background);
  padding: .25rem;
  margin: .125rem;
  border-radius: .25rem;
  left: .125rem;
  bottom: .125rem;
  position: absolute;
  line-height: 1;
  font-size: var(--text-xs);
  font-weight: bold;
  font-family: var(--arial-font);
}

.dhu-button input {
  cursor: pointer;
}

.dhu-hide .upload-preview:not(:hover) .dhu-button {
  display: none;
}

.upload-preview.dhu-hidden .dhu-check:not(:checked) {
  display: none;
}

.upload-preview:not(.dhu-hidden) .dhu-check:checked {
  display: none;
}
`);

const HIDE_BUTTON = '<div class="dhu-button"><input type="checkbox" class="dhu-check"><input type="checkbox" class="dhu-check" checked> hide</div>';

const TOGGLE_BUTTON = '<div id="dhu-toggle"><input type="checkbox" id="dhu-toggle-check"><label for="dhu-toggle-check"> Show hidden</label></div>';

document.querySelector('.preview-size-menu').insertAdjacentHTML('beforebegin', TOGGLE_BUTTON);

for (const upload of document.querySelectorAll('.upload-preview')) {
  if (GM_getValue(upload.getAttribute('data-id'))) upload.classList.add('dhu-hidden');
  upload.querySelector('a').insertAdjacentHTML('beforeend', HIDE_BUTTON);
}

if (GM_getValue('showHidden', false)) {
  document.getElementById('dhu-toggle-check').checked = true;
} else {
  document.body.classList.add('dhu-hide');
}

const clickHandler = function (e) {
  if (e.target.className.match(/dhu-button|dhu-check/)) {
    e.preventDefault();
    const upload = e.target.closest('.upload-preview');
    if (upload.classList.contains('dhu-hidden')) {
      upload.classList.remove('dhu-hidden');
      GM_deleteValue(upload.getAttribute('data-id'));
    } else {
      upload.classList.add('dhu-hidden');
      GM_setValue(e.target.closest('.upload-preview').getAttribute('data-id'), true);
    }
  }
};

const toggleShowHidden = function (e) {
  if (e.target.checked) {
    document.body.classList.remove('dhu-hide');
    GM_setValue('showHidden', true);
  } else {
    document.body.classList.add('dhu-hide');
    GM_setValue('showHidden', false);
  }
};

document.addEventListener('click', clickHandler);
document.getElementById('dhu-toggle-check').addEventListener('change', toggleShowHidden);

Edit: Get sniped aster1a >:). Didn't know it was in the wiki still though so that's useful to know.

Updated by NiceLittleDan

1