From f749c3cffa476367d7a25886bd6d98a6b0536316 Mon Sep 17 00:00:00 2001 From: Bo Kamphues Date: Thu, 26 Nov 2020 13:37:00 +0100 Subject: [PATCH] Fixed publisher not correctly setting publish name --- hooks/path_info.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hooks/path_info.py b/hooks/path_info.py index 9448a09c..5b56e9ea 100644 --- a/hooks/path_info.py +++ b/hooks/path_info.py @@ -21,7 +21,8 @@ # this implementation assumes the version number is of the form 'v###' # coming just before an optional extension in the file/folder name and just # after a '.', '_', or '-'. -VERSION_REGEX = re.compile(r"(.*)([._-])v(\d+)\.?([^.]+)?$", re.IGNORECASE) +# VERSION_REGEX = re.compile(r"(.*)([._-])v(\d+)\.?([^.]+)?$", re.IGNORECASE) +VERSION_REGEX = re.compile(r"(.*)([._-])v(\d+)\.?([^.]+)?\.?([^.]+)?", re.IGNORECASE) # a regular expression used to extract the frame number from the file. # this implementation assumes the version number is of the form '.####' @@ -74,7 +75,10 @@ def get_publish_name(self, path, sequence=False): if version_pattern_match: # found a version number, use the other groups to remove it prefix = version_pattern_match.group(1) - extension = version_pattern_match.group(4) or "" + if len(version_pattern_match.groups()) == 5: + extension = version_pattern_match.group(5) + else: + extension = version_pattern_match.group(4) or "" if extension: publish_name = "%s.%s" % (prefix, extension) else: