From 428757932e1bf713334baff124825b889a1b192b Mon Sep 17 00:00:00 2001 From: stg-annon <14135675+stg-annon@users.noreply.github.com> Date: Sun, 10 Mar 2024 23:52:14 -0400 Subject: [PATCH] [phashDuplicateTagger] use metadata_generate() instead of custom generate_phash() (#276) --- .../phashDuplicateTagger.py | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/plugins/phashDuplicateTagger/phashDuplicateTagger.py b/plugins/phashDuplicateTagger/phashDuplicateTagger.py index ad7b564e..a652087b 100644 --- a/plugins/phashDuplicateTagger/phashDuplicateTagger.py +++ b/plugins/phashDuplicateTagger/phashDuplicateTagger.py @@ -29,15 +29,15 @@ date tags { id } files { - size - path - width - height - bit_rate - created_at - duration - frame_rate - video_codec + size + path + width + height + bit_rate + created_at + duration + frame_rate + video_codec } """ @@ -59,7 +59,7 @@ def main(): if MODE == "clean_scenes": clean_scenes() if MODE == "generate_phash": - generate_phash() + stash.metadata_generate({"phashes": True}) log.exit("Plugin exited normally.") @@ -277,15 +277,6 @@ def get_managed_tags(fragment="id name"): tags.append(tag) return tags - -def generate_phash(): - query = """mutation MetadataGenerate($input: GenerateMetadataInput!) { - metadataGenerate(input: $input) - }""" - variables = {"phashes": True} - stash._callGraphQL(query, variables) - - if __name__ == "__main__": for name, func in getmembers(config, isfunction): if re.match(r"^compare_", name):