Skip to content

Commit 6416844

Browse files
authored
[stashdb-performer-gallery] Add Fragment for find_image (#662)
* Add Fragment for find_image * bump stashdb-performer-gallery version
1 parent 9781f6b commit 6416844

2 files changed

Lines changed: 32 additions & 4 deletions

File tree

plugins/stashdb-performer-gallery/stashdb-performer-gallery.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,34 @@
1515
stash_boxes = {}
1616
scrapers = {}
1717

18+
FRAGMENT_IMAGE = """
19+
id
20+
title
21+
visual_files {
22+
... on ImageFile {
23+
id
24+
path
25+
}
26+
... on VideoFile {
27+
id
28+
path
29+
}
30+
}
31+
paths {
32+
image
33+
thumbnail
34+
}
35+
galleries {
36+
id
37+
}
38+
tags {
39+
id
40+
}
41+
performers {
42+
id
43+
}
44+
"""
45+
1846

1947
def processImages(img):
2048
log.debug("image: %s" % (img,))
@@ -458,13 +486,13 @@ def relink_images(performer_id=None):
458486
elif "hookContext" in json_input["args"]:
459487
id = json_input["args"]["hookContext"]["id"]
460488
if json_input["args"]["hookContext"]["type"] == "Image.Create.Post":
461-
img = stash.find_image(image_in=id)
489+
img = stash.find_image(image_in=id, fragment=FRAGMENT_IMAGE)
462490
processImages(img)
463491
if json_input["args"]["hookContext"]["type"] == "Image.Update.Post":
464-
img = stash.find_image(image_in=id)
492+
img = stash.find_image(image_in=id, fragment=FRAGMENT_IMAGE)
465493
if tag_performer_image in [x["id"] for x in img["tags"]]:
466494
setPerformerPicture(img)
467495
if json_input["args"]["hookContext"]["type"] == "Performer.Update.Post":
468496
stash.run_plugin_task(
469497
"stashdb-performer-gallery", "Process Performers", args={"performer": id}
470-
)
498+
)

plugins/stashdb-performer-gallery/stashdb-performer-gallery.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: stashdb performer gallery
22
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
3-
version: 0.2
3+
version: 0.3
44
url: https://discourse.stashapp.cc/t/stashdb-performer-gallery/1411
55
exec:
66
- python

0 commit comments

Comments
 (0)