[AITagger] bugfix (#338)

assign increment after `if` to avoid div by zero error
This commit is contained in:
stg-annon
2024-06-13 11:59:46 -04:00
committed by GitHub
parent 377457b456
commit 506f69444a

View File

@@ -142,8 +142,8 @@ async def tag_images():
async def tag_scenes():
global increment
scenes = stash.find_scenes(f={"tags": {"value":tagme_tag_id, "modifier":"INCLUDES"}}, fragment="id files {path}")
increment = 1.0 / len(scenes)
if scenes:
increment = 1.0 / len(scenes)
tasks = [__tag_scene(scene) for scene in scenes]
await asyncio.gather(*tasks)
else: