stashapp / CommunityScripts

This is a public repository containing plugin and utility scripts created by the Stash Community.
https://docs.stashapp.cc/add-ons/
GNU Affero General Public License v3.0
189 stars 147 forks source link

[renamerOnUpdate] [Bug?] field_replacer not removing period character in this instance #128

Open echo6ix opened 1 year ago

echo6ix commented 1 year ago

@Belleyy I think the field_replacer bug is back.

default_template = "$studio.$date.$title{_$studio_code}{.$performer}"

field_replacer = {
    "$studio": {"replace": ".", "with": ""},
    "$title": {"replace": ".", "with": ""},
    "$title": {"replace": "--", "with": "-"},
    "$title": {"replace": "---", "with": "-"},
    "$performer":  {"replace": ".", "with": ""}
}
Studio Date Title Performer Expected rename Actual rename
DDF 2015 Ms. Vamp Gets Stuffed Amanda Vamp DDF.2015.Ms-Vamp-Gets-Stuffed.Amanda-Vamp DDF.2015.Ms.-Vamp-Gets-Stuffed.Amanda-Vamp

Notice in the Actual rename column that the . character isn't replaced with a null value in the $title

config.zip

BlokeCDP commented 1 year ago

As discussed, this is because you have 3 $title field replacements and is currently setup for one field replacement per field.

field_replacer would need to support multiple values per key.