Skip to content

Commit

Permalink
Add more debug output and specify the task description
Browse files Browse the repository at this point in the history
  • Loading branch information
niemands committed Oct 22, 2020
1 parent a599c2c commit e4eb617
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gallerytags.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Copy information to gallery
description: Copy information from attached scene to all galleries with CopyTags tag
version: 1.0
version: 1.1
url: https://github.com/niemands/StashPlugins
exec:
- python
- "{pluginDir}/py_plugins/gallerytags.py"
interface: raw
tasks:
- name: Create CopyTags tag
description: Creates a "CopyTags" tag. Add this tag to any gallery
description: Create the "CopyTags" tag. Add this tag to all galleries where you want to copy the information from the attached scene
defaultArgs:
mode: create
- name: Remove CopyTags tag
Expand Down
8 changes: 8 additions & 0 deletions py_plugins/gallerytags.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ def run(json_input, output):
def copy_tags(client):
count = 0
tag = client.findTagIdWithName("CopyTags")
if tag is None:
sys.exit("Tag CopyTags does not exist. Please create it via the 'Create CopyTags tag' task")

tag_ids = [tag]

galleries = client.findGalleriesByTags(tag_ids)

log.LogDebug(f"Found {len(galleries)} galleries with CopyTags tag")

# TODO: Multithreading
for gallery in galleries:
if gallery.get('scene') is not None:
Expand Down Expand Up @@ -85,6 +90,9 @@ def add_tag(client):

if tag_id is None:
client.createTagWithName(tag_name)
log.LogInfo("Tag created successfully")
else:
log.LogInfo("Tag already exists")


def remove_tag(client):
Expand Down

0 comments on commit e4eb617

Please # to comment.