Enhancement: Extend CJ Card Tweaks to Include Stash Count#671
Open
Stash-KennyG wants to merge 10 commits intostashapp:mainfrom
Open
Enhancement: Extend CJ Card Tweaks to Include Stash Count#671Stash-KennyG wants to merge 10 commits intostashapp:mainfrom
Stash-KennyG wants to merge 10 commits intostashapp:mainfrom
Conversation
- Introduced a new setting to enable/disable the Stash ID icon on performer cards. - Implemented functionality to display an icon indicating the presence of Stash IDs for performers. - Updated CSS styles to accommodate the new icon.
Trigger run
- Updated `maybeAddStashIDIcon` to fetch performer data via GraphQL for stash IDs. - Added error handling for fetching stash ID icons. - Introduced a new asynchronous function `fetchPerformerStashIDs` to retrieve stash IDs.
- Updated `maybeAddStashIDIcon` to improve the logic for adding Stash ID icons. - Introduced a MutationObserver to dynamically handle card-popovers and fetch stash IDs. - Enhanced error handling and updated CSS styles for better display of Stash ID counts. - Adjusted settings description for clarity.
- Updated `maybeAddStashIDIcon` to only show the Stash ID button if the count is greater than 0. - Modified error handling to silently fail without displaying a count when an error occurs.
- Updated README.md to include details about the new Stash ID icon feature. - Described the icon's appearance, tooltip functionality, and its purpose in identifying performers linked to external Stash databases.
Author
|
Everything looks great in my side - thought I would send it forward. |
|
This pull request has been mentioned on Stash Forum. There might be relevant details there: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhancement: Stash ID Count Indicator for Performer Cards
Summary
Adds a visual indicator to performer cards showing the count of Stash IDs (GUIDs) attached to each performer. This helps users quickly identify performers linked to external Stash databases and see how many Stash IDs each performer has.
Feature Description
stashIDIcon(boolean, default: false)card-popoversbutton group area of performer cardsbtn-primaryclass.stash-id-countelement)Technical Implementation
GraphQL Integration
queryStashIDs()async function that queries:/performers/{id})DOM Manipulation
maybeAddStashIDIcon(): Main entry point, extracts performer ID from cardaddStashIDButton(): Creates and inserts the button element into.card-popovers.btn-groupcreateElementFromHTML()helper for safe DOM creationStyling
.stash-id-countwith flexbox layout.stash-id-count-numberwith right margin.stash-id-iconwith SVG sizing (0.875rem)#fff) to contrast with primary button backgroundChanges Made
Files Modified
plugins/cjCardTweaks/cjCardTweaks.jsstashIDIcontoparseSettings()STASH_ID_ICON_STYLECSS constantmaybeAddStashIDIcon()functionqueryStashIDs()async function for GraphQL queriesaddStashIDButton()helper functionhandlePerformersCards()execution flowplugins/cjCardTweaks/cjCardTweaks.ymlplugins/cjCardTweaks/README.mdExample Usage
When enabled, performer cards with Stash IDs will display a button like: