CommunityScripts icon indicating copy to clipboard operation
CommunityScripts copied to clipboard

[renamerOnUpdate] field_whitespaceSeperator prevents files with whitespace from being found.

Open unatco90 opened this issue 3 years ago • 0 comments

If field_whitespaceSeperator in renamerOnUpdate_config.py is set to a non-space character, it will replace spaces in the current file path, preventing files from being found.

For example, /data/foo bar/baz.01.02.03.foo.bar.mp4 results in the following error when being renamed:

[Plugin / renamerOnUpdate] [OS] File doesn't exist in your Disk/Drive (/data/foo.bar/baz.01.02.03.foo.bar.mp4)

In renamerOnUpdate.py, the current file path is stored in scene_information['current_path']: scene_information['current_path'] = str(scene['path'])

However, the logic for replacing whitespace overwrites characters in current_path, causing the issue:

    if FIELD_WHITESPACE_SEP:
        for key, value in scene_information.items():
            if type(value) is str:
                scene_information[key] = value.replace(" ", FIELD_WHITESPACE_SEP)
            elif type(value) is list:
                scene_information[key] = [x.replace(" ", FIELD_WHITESPACE_SEP) for x in value]
    return scene_information

unatco90 avatar Nov 17 '22 17:11 unatco90