User Tools

Site Tools


config:stash

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
config:stash [2024/07/28 13:08] Wuffconfig:stash [2025/08/30 00:01] (current) – [api] Wuff
Line 20: Line 20:
  
  
-===== Custom CSS =====+===== Custom CSS/JS =====
  
-Custom CSS needs to be enabled in Settings->Interface->Custom CSS->Enable then Edit+Custom CSS/Javascript needs to be enabled in Settings->Interface->Custom CSS->Enable then Edit
  
 Note: Firefox before v120/121 needs: about:config value of layout.css.has-selector.enabled set to true Note: Firefox before v120/121 needs: about:config value of layout.css.has-selector.enabled set to true
Line 80: Line 80:
  
 </code> </code>
 +
 +==== Scene Search at top ====
 +
 +This moves the scene search from the sidebar to the top bar
 +
 +<code javascript>
 +// Move search from sidebar next to filter at top
 +(function() {
 +  const sourceSelector = 'body div div.main.container-fluid div.item-list-container.scene-list div.sidebar-pane div.sidebar div.sidebar-search-container';
 +  const targetSelector = 'body div div.main.container-fluid div.item-list-container.scene-list.hide-sidebar div.sidebar-pane.hide-sidebar div div.scene-list-toolbar.btn-toolbar';
 +
 +  const observer = new MutationObserver(() => {
 +    const sourceElement = document.querySelector(sourceSelector);
 +    const targetContainer = document.querySelector(targetSelector);
 +
 +    if (sourceElement && targetContainer) {
 +      targetContainer.insertBefore(sourceElement, targetContainer.lastChild);
 +      observer.disconnect(); // Stop observing once done
 +      console.log('Moved element to target container.');
 +    }
 +  });
 +
 +  // Observe the entire document for added/removed elements
 +  observer.observe(document.body, {
 +    childList: true,
 +    subtree: true
 +  });
 +})();
 +</code>
 +
 +==== Studio as Text ====
 +
 +This replaces unset studio logos with a clickable text link.
 +
 +CSS
 +<code css>
 +/* Studio as text */
 +a[data-processed] {
 +    font-size: 1.5rem;
 +    color: inherit;
 +    text-decoration: none;
 +    display: inline-block;
 +}
 +
 +a[data-processed]:hover {
 +    text-decoration: underline;
 +}
 +
 +</code>
 +
 +Javascript
 +<code javascript>
 +/* Studio as text */
 +function processStudioLogos() {
 +    document.querySelectorAll('.studio-logo').forEach(img => {
 +        const link = img.closest('a');
 +        if (link && img.alt && !link.hasAttribute('data-processed') && img.src.includes('default=true')) {
 +            const cleanName = img.alt.replace(/\s+logo$/i, '');
 +            link.textContent = cleanName;
 +            link.setAttribute('data-processed', 'true');
 +        }
 +    });
 +}
 +
 +const observer = new MutationObserver(function(mutations) {
 +    mutations.forEach(function(mutation) {
 +        if (mutation.addedNodes.length) {
 +            processStudioLogos();
 +        }
 +    });
 +});
 +
 +observer.observe(document.body, {
 +    childList: true,
 +    subtree: true
 +});
 +</code>
 +
  
  
Line 87: Line 165:
  
 https://github.com/stashapp/stash/issues/3918 https://github.com/stashapp/stash/issues/3918
 +
 +
 +<code>
 +#If API authentication is required, add the following to the curl commands:
 +-H "ApiKey: YOUR_API_KEY_HERE" \
 +</code>
 +
 +<code>
 +# Metadata Scan of a particular directory
 +curl -X POST http://192.168.1.2:9998/graphql \
 +  -H "Content-Type: application/json" \
 +  -d '{
 +    "query": "mutation MetadataScan($paths: [String!]!) { metadataScan(input: { paths: $paths }) }",
 +    "variables": {
 +      "paths": ["/data/stash-temp"]
 +    }
 +  }'
 +
 +curl -X POST http://localhost:9999/graphql \
 +  -H "Content-Type: application/json" \
 +  -d '{
 +    "query": "mutation { scanMetadata(input: { paths: [\"/path/to/your/folder\"] generateCovers: true generatePreviews: true generateSprites: true generatePhashes: true }) }"
 +  }'
 +</code>
 +
 +
 +<code>
 +# Full Metadata Scan
 +curl -X POST http://localhost:9998/graphql \
 +  -H "Content-Type: application/json" \
 +  -d '{"query": "mutation { metadataScan(input: {}) }"}'
 +
 +curl -X POST http://localhost:9999/graphql \
 +  -H "Content-Type: application/json" \
 +  -d '{"query": "mutation { scanMetadata(input: { generateCovers: true generatePreviews: true generateSprites: true generatePhashes: true }) }"}'
 +
 +</code>
 +
 +Show status:
 +<code>
 +curl -X POST http://localhost:9999/graphql \
 +  -H "Content-Type: application/json" \
 +  -d '{"query": "{ metadataScanStatus { status progress } }"}'
 +</code>
 +
 +Show status until done:
 +<code>
 +while true; do
 +  curl -s -X POST http://localhost:9999/graphql \
 +    -H "Content-Type: application/json" \
 +    -d '{"query": "{ metadataScanStatus { status progress } }"}' \
 +  | jq '.data.metadataScanStatus';
 +  sleep 5;
 +done
 +</code>
 +
  
  
Line 362: Line 496:
     #merge_scenes_with_same_filename(STASH_SCHEME, STASH_HOST, STASH_PORT, DELETE, DRYRUN, FILE)     #merge_scenes_with_same_filename(STASH_SCHEME, STASH_HOST, STASH_PORT, DELETE, DRYRUN, FILE)
 </code> </code>
 +
 +
config/stash.1722168534.txt.gz · Last modified: by Wuff