Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions plugins/stashdb-performer-gallery/stashdb-performer-gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,34 @@
stash_boxes = {}
scrapers = {}

FRAGMENT_IMAGE = """
id
title
visual_files {
... on ImageFile {
id
path
}
... on VideoFile {
id
path
}
}
paths {
image
thumbnail
}
galleries {
id
}
tags {
id
}
performers {
id
}
"""


def processImages(img):
log.debug("image: %s" % (img,))
Expand Down Expand Up @@ -458,13 +486,13 @@ def relink_images(performer_id=None):
elif "hookContext" in json_input["args"]:
id = json_input["args"]["hookContext"]["id"]
if json_input["args"]["hookContext"]["type"] == "Image.Create.Post":
img = stash.find_image(image_in=id)
img = stash.find_image(image_in=id, fragment=FRAGMENT_IMAGE)
processImages(img)
if json_input["args"]["hookContext"]["type"] == "Image.Update.Post":
img = stash.find_image(image_in=id)
img = stash.find_image(image_in=id, fragment=FRAGMENT_IMAGE)
if tag_performer_image in [x["id"] for x in img["tags"]]:
setPerformerPicture(img)
if json_input["args"]["hookContext"]["type"] == "Performer.Update.Post":
stash.run_plugin_task(
"stashdb-performer-gallery", "Process Performers", args={"performer": id}
)
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: stashdb performer gallery
description: Automatically download performer images from stashdb or other stash-boxes. Add the [Stashbox Performer Gallery] tag to a performer and it will create a gallery of images from that stash-box database. Apply the tag [Set Profile Image] to an image to set it as the profile image of that performer. Note you will need to configure the download path and add this as a path under settings > library
version: 0.2
version: 0.3
url: https://discourse.stashapp.cc/t/stashdb-performer-gallery/1411
exec:
- python
Expand Down