From 6c6b30f1999273e3d43e4c19083cfe37640e5627 Mon Sep 17 00:00:00 2001 From: karrcharon Date: Thu, 2 Jan 2025 21:19:31 +0800 Subject: [PATCH] - --- __init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 632a5b9..0213222 100755 --- a/__init__.py +++ b/__init__.py @@ -213,6 +213,7 @@ def find_model(mtype, model_name) -> Path: class ThumbnailManager: _code_map = {} + _path_code_map = {} _image_map = {} _image_time = {} @@ -221,7 +222,8 @@ def add_code(cls, path: str): if path not in cls._image_map: code = md5(path.encode()).hexdigest() cls._code_map[code] = path - return cls._code_map.get(code, "") + cls._path_code_map[path] = code + return cls._path_code_map.get(path, "") @classmethod def get_path(cls, code: str) -> str: