switch to any comparison instead of all for allowed suffixes to prevent issues with file names that contain additional periods, ie part_v2.1.gcode.3mf

This commit is contained in:
jneilliii
2024-11-01 20:12:34 -04:00
parent 3c8b904a26
commit 21e30034d0
2 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ class CachedFileView:
def _get_file_by_stem_cached(self, file_stem: str, allowed_suffixes: list[str]):
for file_path_str in list(self._file_data_cache.keys()) + list(self._file_alias_cache.keys()):
file_path = Path(file_path_str)
if file_stem == file_path.with_suffix("").stem and all(
if file_stem == file_path.with_suffix("").stem and any(
suffix in allowed_suffixes for suffix in file_path.suffixes
):
return self.get_file_data_cached(file_path)