mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-04-21 12:49:41 -05:00
[renamer] Don't count male performers if they're being ignored (#44)
This commit is contained in:
@@ -399,18 +399,27 @@ def renamer(scene_id):
|
||||
# Grab Performer
|
||||
if STASH_SCENE.get("performers"):
|
||||
perf_list = ""
|
||||
if len(STASH_SCENE["performers"]) > PERFORMER_LIMIT:
|
||||
perf_count = 0
|
||||
|
||||
for perf in STASH_SCENE["performers"]:
|
||||
#log.LogDebug(performer)
|
||||
if PERFORMER_IGNORE_MALE and perf["gender"] == "MALE":
|
||||
continue
|
||||
|
||||
if perf_count > PERFORMER_LIMIT:
|
||||
# We've already exceeded the limit. No need to keep checking
|
||||
break
|
||||
|
||||
perf_list += perf["name"] + PERFORMER_SPLITCHAR
|
||||
perf_count += 1
|
||||
|
||||
# Remove last character
|
||||
perf_list = perf_list[:-len(PERFORMER_SPLITCHAR)]
|
||||
|
||||
if perf_count > PERFORMER_LIMIT:
|
||||
log.LogInfo("More than {} performer(s). Ignoring $performer".format(PERFORMER_LIMIT))
|
||||
else:
|
||||
for perf in STASH_SCENE["performers"]:
|
||||
#log.LogDebug(performer)
|
||||
if PERFORMER_IGNORE_MALE:
|
||||
if perf["gender"] != "MALE":
|
||||
perf_list += perf["name"] + PERFORMER_SPLITCHAR
|
||||
else:
|
||||
perf_list += perf["name"] + PERFORMER_SPLITCHAR
|
||||
# Remove last character
|
||||
perf_list = perf_list[:-len(PERFORMER_SPLITCHAR)]
|
||||
perf_list = ""
|
||||
|
||||
scene_information["performer"] = perf_list
|
||||
|
||||
# Grab Studio name
|
||||
|
||||
Reference in New Issue
Block a user