diff --git a/plugins/stashSetStashboxFavoritePerformers/favorite_performers_sync.py b/plugins/stashSetStashboxFavoritePerformers/favorite_performers_sync.py index 4d713cc..0fb9dfd 100644 --- a/plugins/stashSetStashboxFavoritePerformers/favorite_performers_sync.py +++ b/plugins/stashSetStashboxFavoritePerformers/favorite_performers_sync.py @@ -154,7 +154,7 @@ def tag_performer(db: StashDatabase, stash_id: str, tag_id: int): else: log.debug(f'Performer already tagged {stash_id} {performer.id} {performer.name}') -def set_stashbox_favorite_performers(db: StashDatabase, endpoint: str, boxapi_key: str, tagErrors: bool, tagName: str): +def set_stashbox_favorite_performers(db: StashDatabase, endpoint: str, boxapi_key: str, tag_errors: bool, tag_name: str): stash_ids = set([row["stash_id"] for row in db.fetchall("""SELECT DISTINCT b.stash_id FROM performers a JOIN performer_stash_ids b @@ -163,13 +163,13 @@ def set_stashbox_favorite_performers(db: StashDatabase, endpoint: str, boxapi_ke log.info(f'Stashbox endpoint {endpoint}') log.info(f'Stash {len(stash_ids)} favorite performers') tag = None - if tagErrors and tagName: - log.info(f'Tagging errors with performer tag: {tagName}') - tag = db.tags.selectone_name(tagName) + if tag_errors and tag_name: + log.info(f'Tagging errors with performer tag: {tag_name}') + tag = db.tags.selectone_name(tag_name) if not tag: log.info(f'Tag missing. Creating...') - db.tags.insert(tagName, get_timestamp(), get_timestamp(), True, 'Tag created by Set Stashbox Favorite Performers plugin. Applied to performers found to have stash ids deleted from stashbox.', None) - tag = db.tags.selectone_name(tagName) + db.tags.insert(tag_name, get_timestamp(), get_timestamp(), True, 'Tag created by Set Stashbox Favorite Performers plugin. Applied to performers found to have stash ids deleted from stashbox.', None) + tag = db.tags.selectone_name(tag_name) if not tag: log.error(f"Failed to create tag.") else: diff --git a/plugins/stashSetStashboxFavoritePerformers/stashSetStashboxFavoritePerformers.py b/plugins/stashSetStashboxFavoritePerformers/stashSetStashboxFavoritePerformers.py index 3c81284..bb64f3d 100644 --- a/plugins/stashSetStashboxFavoritePerformers/stashSetStashboxFavoritePerformers.py +++ b/plugins/stashSetStashboxFavoritePerformers/stashSetStashboxFavoritePerformers.py @@ -24,9 +24,9 @@ def get_database_config(): log.debug(f"databasePath: {database_path}") return database_path, blobs_path, blobs_storage -pluginSettings = client.callGraphQL("""query Configuration { configuration { plugins } }""")['configuration']['plugins'].get('stashSetStashboxFavoritePerformers', {}) -tagErrors = pluginSettings.get('tagErrors', False) -tagName = pluginSettings.get('tagName') +plugin_settings = client.callGraphQL("""query Configuration { configuration { plugins } }""")['configuration']['plugins'].get('stashSetStashboxFavoritePerformers', {}) +tag_errors = plugin_settings.get('tagErrors', False) +tag_name = plugin_settings.get('tagName') if name == 'favorite_performers_sync': endpoint = json_input['args']['endpoint'] @@ -36,7 +36,7 @@ def get_database_config(): except Exception as e: log.error(str(e)) sys.exit(0) - set_stashbox_favorite_performers(db, endpoint, api_key, tagErrors, tagName) + set_stashbox_favorite_performers(db, endpoint, api_key, tag_errors, tag_name) db.close() elif name == 'favorite_performer_sync': endpoint = json_input['args']['endpoint'] diff --git a/plugins/stashSetStashboxFavoritePerformers/stashSetStashboxFavoritePerformers.yml b/plugins/stashSetStashboxFavoritePerformers/stashSetStashboxFavoritePerformers.yml index 11ba6d2..2104a82 100644 --- a/plugins/stashSetStashboxFavoritePerformers/stashSetStashboxFavoritePerformers.yml +++ b/plugins/stashSetStashboxFavoritePerformers/stashSetStashboxFavoritePerformers.yml @@ -1,7 +1,7 @@ name: Stash Set Stashbox Favorite Performers # requires: stashUserscriptLibrary7dJx1qP description: Set Stashbox favorite performers according to stash favorites -version: 0.6.1 +version: 0.6.2 url: https://github.com/7dJx1qP/stash-plugins#stash-set-stashbox-favorite-performers ui: requires: