Allow single scene groups to link directly to scene play page on poster click

Describe the feature you’d like

A toggle or option to allow a click on a movie poster in groups tab to directly play a movie if the scene count within the group is 1.

Describe the benefits this would bring to existing users

Streamlining the ‘movie experience’ with the groups tab

Is there an existing way to achieve this goal?

Not natively or through a specific plugin that I could find, though I have hashed out a tampermonkey script that seems to be working well enough for the time being.

// ==UserScript==
// @name         Stash Groups Direct Scene Clicker
// @namespace    http://tampermonkey.net
// @version      16.0
// @description  Ensures duplicate link components do not break single-scene detection, with fixed element array references.
// @author       Brisket
// @match        *://*/\*
// @include      \*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
‘use strict’;

function checkAndRedirect() {
    const currentUrl = window.location.href;

    // Step 1: Detect if Stash transitioned to the sub-scenes group list overview
    if (currentUrl.includes('/groups/') && currentUrl.includes('/scenes')) {

        // Step 2: Query all link elements matching the scene path template
        const sceneCards = document.querySelectorAll('.scene-card a[href*="/scenes/"], [class*="scene-card"] a[href*="/scenes/"], a[href*="/scenes/"]');

        const uniqueUrls = new Set();
        const validSceneLinks = [];

        // Step 3: Enforce strict URL structural patterns and drop duplicate links
        Array.from(sceneCards).forEach(el => {
            const href = el.getAttribute('href') || '';
            const exactScenePattern = /\/scenes\/\d+(\/)?($|\?)/;

            // Only save the link if it is a numeric scene ID and hasn't been counted yet
            if (exactScenePattern.test(href) && !href.includes('markers') && !uniqueUrls.has(href)) {
                uniqueUrls.add(href);
                validSceneLinks.push(el);
            }
        });

        // Step 4: If the group page contains exactly ONE unique scene file destination link
        if (validSceneLinks.length === 1) {
            // Corrected Array Syntax: Added bracket identifier [0] to extract the link
            const cleanScenePath = validSceneLinks[0].getAttribute('href');

            if (cleanScenePath) {
                // Instantly forward to the true media file location
                window.location.replace(window.location.origin + cleanScenePath);
            }
        }
    }
}

// Attach listener hooks to capture Single Page Application history updates
const originalPushState = history.pushState;
history.pushState = function() {
    originalPushState.apply(this, arguments);
    checkAndRedirect();
};

const originalReplaceState = history.replaceState;
history.replaceState = function() {
    originalReplaceState.apply(this, arguments);
    checkAndRedirect();
};

window.addEventListener('popstate', checkAndRedirect);

// Track dynamic React layout updates as cards drop onto the page grid canvas
const observer = new MutationObserver(() => checkAndRedirect());
observer.observe(document, { childList: true, subtree: true });

})();

Additional context