Skip to content

Add Group Details plugin for Group Cards#700

Open
Stash-KennyG wants to merge 29 commits intostashapp:mainfrom
Stash-KennyG:pr/groupdetails-mainline-v0.2.0
Open

Add Group Details plugin for Group Cards#700
Stash-KennyG wants to merge 29 commits intostashapp:mainfrom
Stash-KennyG:pr/groupdetails-mainline-v0.2.0

Conversation

@Stash-KennyG
Copy link
Copy Markdown
Contributor

@Stash-KennyG Stash-KennyG commented Apr 13, 2026

Summary

Add the GroupDetails plugin for group cards with computed duration and average vertical resolution metrics from GraphQL scene data

What It Adds

  • Date line: appends total duration (H:MM:SS) to the right side of the date row.
  • Chip list: appends a resolution chip (PNG badge) to the end of .card-popovers.
  • Tooltips: duration and resolution both expose tooltips with more detailed information.

Overview

image

Data Source

Metrics are computed in-browser from GraphQL findGroup scene data (id, title, files { duration height }, groups { group { id } scene_index }).

Scene Filtering

The goal of the plugin is to include the feature portion of the attached scenes. Often individuals select -1 or 99 for things like trailers or BTS. This filter can be disabled by ticking include all scenes. When disabled (default), scenes are included only if scene_index is:

  • null, or
  • an integer in 0..89

Exception: if the group has exactly one scene, scene-index filtering is bypassed for that group.

When Include all scenes is enabled, all returned scenes are included regardless of scene_index.

image

Sorting

Duration tooltip scene lines are sorted by:

  1. scene_index ascending (null sorts as 90)
  2. duration descending
  3. scene id ascending (stable tie-break)

Duration Metric

  • Uses each included scene's max file duration.
  • Card value is total duration displayed as H:MM:SS.
  • Tooltip lists every included scene as:
    • N. Title H:MM:SS when scene_index is present
    • Title H:MM:SS when scene_index is null

Resolution Metric

Average resolution uses vertical pixels (height) from each included scene's tallest file:

  • For groups with exactly one total file, the duration gate is bypassed.
  • Otherwise, only scenes with duration > 360 are eligible. Goal: Exclude sub-6 minute scenes to filter trailers etc.
  • Resolution average is round(sum(height) / count).
  • Tooltip format is:
    • Resolution Average: <N>p
    • or Resolution Average: — when no eligible average exists.

Resolution chip empty/dash behavior:

  • If there are no files (or single-file case with unusable height): render nothing.
  • If totalFileCount > 1 and no eligible average: render .

Resolution Badge Mapping

The plugin picks a PNG badge using a 2% tolerance (>= 98% of target resolution):

  • < 234 -> 144p.png
  • then highest match from:
    • 240, 360, 480, 720, 1080, 1440 (2k), 2160 (4k), 2880 (5k), 3160 (6k), 4320 (8k)

Test plan

  • open /groups and verify duration appears on the date line, right-aligned
  • verify resolution chip is appended as the last popover chip and tooltip reads Resolution Average: <N>p or
  • confirm scene filtering/sorting behavior in duration tooltip (scene_index ordering with null handling and secondary duration sort)
  • run bash plugins/GroupDetails/build.sh and confirm images.js is regenerated from assets/*.png
  • hard refresh Stash UI and confirm embedded image badges render without plugin asset URL dependence

AI assisted. Human Verified

KennyG added 28 commits April 10, 2026 17:05
UI plugin for group list cards: filtered total duration and average vertical resolution with GraphQL-backed metrics.

Made-with: Cursor
Enhance metrics display by adding a new setting to include all scenes in calculations, allowing for a more comprehensive view of total duration and average vertical resolution. Adjusted CSS for improved layout and responsiveness of metrics. Updated README to reflect new functionality and usage instructions.

Made-with: Cursor
Updated the CSS for the Group Details plugin to implement a stacked layout for metrics, improving visual clarity. Adjusted JavaScript to add tooltip support for scene metrics, ensuring better user experience. Incremented version to 0.1.6 and updated README to reflect layout changes and tooltip functionality.
Stack duration and scene count above a resolution row; show resolution as FA-based bucket icons via PluginApi with free-tier fallbacks; extend tooltips with average height header and scene lists; bump to 0.1.7.

Made-with: Cursor
Enhance tooltip functionality by ensuring the resolution icon wrapper captures hover events for better user experience. Adjust JavaScript to default icon dimensions to 512 if not specified, and update README to clarify tooltip behavior. Increment version to 0.1.8.
Enhance tooltip functionality by adding detailed resolution sample lines for scenes contributing to the average vertical height. Update the README to clarify the tooltip behavior for both duration and resolution metrics. Increment version to 0.1.9.
Refactor resolution bucket handling by replacing Font Awesome icons with inline SVGs for better visual distinction. Adjust resolution bucket labels to include correct comparisons. Update README to reflect changes in icon usage and resolution bucket definitions. Increment version to 0.1.20.
Removed the resolution sample line formatting and adjusted the tooltip to display a simplified resolution average. Updated the README to reflect changes in tooltip behavior and versioning. Incremented version to 0.1.11.
Modified the tooltip header for total duration to enhance clarity by removing unnecessary details. This change aims to improve user understanding of the displayed information. No version increment required.
Refine resolution bucket icons and tooltip text for clarity. Adjusted the tooltip to display resolution average in pixels correctly and updated the README to reflect changes in icon usage and bucket definitions. Incremented version to 0.1.12.
Refine scene eligibility logic to ensure that single-scene groups are always included in metrics, regardless of their scene_index. Updated README to clarify this exception and adjusted the version number accordingly.
…ion 0.1.15

Introduced new PNG images for various video resolutions (144p, 240p, 360p, 480p, 720p, 1080p, 2k, 4k, 5k, 6k, and 8k) to enhance visual representation in the Group Details plugin. Updated the JavaScript to utilize these images for resolution metrics and refined the CSS for better display. Incremented version to 0.1.15.
Added total file count calculation to enhance metrics in the Group Details plugin. Adjusted resolution bucket rendering logic to conditionally display content based on the number of files. Incremented version to 0.1.17.
Refactor CSS and JavaScript to enhance date line display within group cards. Introduced new functions to find and mount duration on date lines, improving the overall layout and user experience. Incremented version to 0.1.19.
… encoding

Introduced a new PLUGIN_BASE_URL to dynamically determine the base URL for plugin assets, improving flexibility. Updated the getResolutionPngSrcCandidates function to use safeName for file names, ensuring proper URL encoding. Incremented version to 0.1.20.
Incremented version to 0.1.22. Removed unused fileName variable from JavaScript and added new asset mappings for various video resolutions (144p, 240p, 360p, 480p, 720p, 1080p, 2k, 4k, 5k, 6k, and 8k) in the YAML configuration to enhance visual representation in the Group Details plugin.
…ersion to 0.1.23

Removed unnecessary DOM manipulation for metrics rows and streamlined the addition of resolution nodes. Updated the version in the YAML configuration to reflect these changes.
…nd update version to 0.1.24

Removed the dynamic base URL logic and replaced it with a direct mapping to embedded resolution images for improved performance. Added a new JavaScript file for image mappings and updated the version in the YAML configuration.
…solution image and optimizing the embedded resolution images for better performance. This change streamlines the image assets used in the plugin, ensuring only relevant resolutions are included.
…solution image and optimizing the embedded resolution images for better performance. This change streamlines the image assets used in the plugin, ensuring only relevant resolutions are included.
…lution image and optimizing the embedded resolution images for better performance. This change further streamlines the image assets used in the plugin, ensuring only relevant resolutions are included.
…d 360p resolution images and optimizing the embedded 144p image for better performance. This change continues to streamline the image assets used in the plugin, ensuring only essential resolutions are included.
…ild script for asset management. Updated version to 0.1.26 to reflect these changes.
…image assets for 1080p and 144p resolutions. This change continues to optimize the image assets used in the plugin, ensuring a more comprehensive range of resolutions is available for better performance and visual representation.
…ion badges.

Regenerate 240/360/480/720/1080 badge assets with numeric-only labels and rebuild images.js so the embedded data URIs match the updated graphics.

Made-with: Cursor
…d improving scene tooltip formatting. Removed obsolete resolution badge assets to streamline the plugin's performance and visual representation.
@Stash-KennyG Stash-KennyG changed the title Add and iterate Group Details plugin for group cards Add Group Details plugin for Group Cards Apr 13, 2026
for scene eligibility and updating related documentation.
Update Group Details plugin to version 0.2.1
@DogmaDragon DogmaDragon added the type:plugin Plugins label Apr 13, 2026
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to be a rogue file?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to be a production file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants