diff --git a/plugins/stashdb-performer-gallery/stashdb-performer-gallery.py b/plugins/stashdb-performer-gallery/stashdb-performer-gallery.py index f030fb7f..e103786e 100644 --- a/plugins/stashdb-performer-gallery/stashdb-performer-gallery.py +++ b/plugins/stashdb-performer-gallery/stashdb-performer-gallery.py @@ -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,)) @@ -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} - ) + ) \ No newline at end of file diff --git a/plugins/stashdb-performer-gallery/stashdb-performer-gallery.yml b/plugins/stashdb-performer-gallery/stashdb-performer-gallery.yml index 6ff4ff26..0a96728e 100644 --- a/plugins/stashdb-performer-gallery/stashdb-performer-gallery.yml +++ b/plugins/stashdb-performer-gallery/stashdb-performer-gallery.yml @@ -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