stg-annon/StashScripts

๐Ÿž[Bug] [phashDuplicateTagger] missing config.py

Closed this issue ยท 2 comments

Plugin missing config.py file. This triggers the following error when running any task:

2024-09-11 16:07:45Error   [Plugin / PHash Duplicate Tagger] ModuleNotFoundError: No module named 'config'
2024-09-11 16:07:45Error   [Plugin / PHash Duplicate Tagger]     import config
2024-09-11 16:07:45Error   [Plugin / PHash Duplicate Tagger]   File "C:\Users\admin3\.stash\plugins\phashDuplicateTagger\phashDuplicateTagger.py", line 15, in <module>

There is a config_example.py file. I'm not sure if that needs to be renamed to config.py.

Generally speaking, a config file is usually something simple which a non-programmer can easily edit and customize.
IMHO, the config_example.py is too complicated for a novice user.

I recommend putting the functions in a custom_function.py file, and only keeping the variables in the config.py file.

I also recommend moving the below variables from the config file to the Stash plugin UI.

KEEP_TAG_NAME = "[PDT: Keep]"
REMOVE_TAG_NAME = "[PDT: Remove]"
UNKNOWN_TAG_NAME = "[PDT: Unknown]"
IGNORE_TAG_NAME = "[PDT: Ignore]"
IGNORE_PATHS = []

You can check out plugin DupFileManager for example coding which uses Stash UI variables.

missing config resolved by 4d6187c

The plugin predates plugin variables feature in stash, it's also not really intended to be changed very often or even at all unless the user does not like those tags specifically, there is also an issue with plugin values where the data you put into it might not be the data you get out because of how it is translated to be stored in Stash's config.yml