Rename movie to group

Updates the definition in all files and adds the subgroups path to the group pattern.
This commit is contained in:
HandyRandyx
2024-10-03 21:34:12 -03:00
parent e6eead60e0
commit 0b2548cae6
5 changed files with 19 additions and 18 deletions

View File

@@ -5,7 +5,7 @@ Hot Cards is a Stash CommunityScript plugin designed to enhance your visual expe
## Features
- Custom styling to card elements that match a specified Tag ID or Rating Threshold.
- Enable or disable Hot Cards on various sections like home, scenes, images, movies, galleries, performers, and studios.
- Enable or disable Hot Cards on various sections like home, scenes, images, groups, galleries, performers, and studios.
- Specify Hot Cards to be tag-based or rating-based for each card type, as desired.
- Customizable Hot Cards.
- Support for multi-tag and multi-style configurations.
@@ -19,7 +19,7 @@ Hot Cards is a Stash CommunityScript plugin designed to enhance your visual expe
## Usage
After installation, you can configure the plugin to suit your needs. Set a desired Tag ID or Rating Threshold and enable Hot Cards for the card types you want. Customize the appearance of Hot Cards for each type of card (scene, image, movie, gallery, performer, studio) using the format provided or leave the fields empty to apply the default style.
After installation, you can configure the plugin to suit your needs. Set a desired Tag ID or Rating Threshold and enable Hot Cards for the card types you want. Customize the appearance of Hot Cards for each type of card (scene, image, group, gallery, performer, studio) using the format provided or leave the fields empty to apply the default style.
### Configure the field format:

View File

@@ -34,7 +34,7 @@ async function hotCardsSetup() {
const hotCardsHandlers = {
gallery: handleGalleriesHotCards,
image: handleImagesHotCards,
movie: handleMoviesHotCards,
group: handleGroupsHotCards,
performer: handlePerformersHotCards,
scene: handleScenesHotCards,
studio: handleStudiosHotCards,
@@ -173,18 +173,19 @@ function handleImagesHotCards(type) {
}
/**
* Adds movie hot cards to specific paths in the application.
* Adds group hot cards to specific paths in the application.
*
* The supported paths are:
* - /movies
* - /performers/{id}/movies
* - /studios/{id}/movies
* - /tags/{id}/movies
* - /groups
* - /groups/{id}/subgroups
* - /performers/{id}/groups
* - /studios/{id}/groups
* - /tags/{id}/groups
* - /scenes/{id}
*/
function handleMoviesHotCards(type) {
function handleGroupsHotCards(type) {
const pattern =
/^\/(movies|(performers|studios|tags)\/\d+\/movies|scenes\/\d+)$/;
/^\/(groups|(groups\/\d+\/subgroups)|(performers|studios|tags)\/\d+\/groups|scenes\/\d+)$/;
addHotCards(pattern, type);
}
@@ -214,12 +215,12 @@ function handlePerformersHotCards(type) {
* - /performers/{id}/scenes
* - /studios/{id}/scenes
* - /tags/{id}/scenes
* - /movies/{id}
* - /groups/{id}
* - /galleries/{id}
*/
function handleScenesHotCards(type) {
const pattern =
/^\/(scenes|(performers|studios|tags|movies)\/\d+\/scenes|(movies|galleries)\/\d+)$/;
/^\/(scenes|(performers|studios|tags|groups)\/\d+\/scenes|(groups|galleries)\/\d+)$/;
addHotCards(pattern, type);
}

View File

@@ -35,8 +35,8 @@ settings:
displayName: Enable for images
description: "Empty to enable, 'd' to disable. Customize: [criterion]_[value]_[style]_[grad-opts]_[hover-opts]_[card-opts]. See docs."
type: STRING
movies:
displayName: Enable for movies
groups:
displayName: Enable for groups
description: "Empty to enable, 'd' to disable. Customize: [criterion]_[value]_[style]_[grad-opts]_[hover-opts]_[card-opts]. See docs."
type: STRING
galleries:

View File

@@ -23,7 +23,7 @@ const DEFAULTS = {
const CARD_KEYS = {
galleries: "gallery",
images: "image",
movies: "movie",
groups: "group",
performers: "performer",
scenes: "scene",
studios: "studio",

View File

@@ -1,7 +1,7 @@
const stash = {
galleries: {},
images: {},
movies: {},
groups: {},
performers: {},
scenes: {},
studios: {},
@@ -11,7 +11,7 @@ stashListener.addEventListener("response", (event) => {
const dataProcessors = {
galleries: processData("findGalleries", "galleries"),
images: processData("findImages", "images"),
movies: processData("findMovies", "movies"),
groups: processData("findGroups", "groups"),
performers: processData("findPerformers", "performers"),
scenes: processData("findScenes", "scenes"),
studios: processData("findStudios", "studios"),
@@ -36,7 +36,7 @@ function processData(findKey, dataKey) {
function processOtherData(data) {
const otherDataMappings = [
{ findKey: "findScene", key: "movies", nested: true },
{ findKey: "findScene", key: "groups", nested: true },
{ findKey: "findScene", key: "galleries", nested: false },
{ findKey: "findScene", key: "performers", nested: false },
{ findKey: "findImage", key: "performers", nested: false },