From 2ad17a6100be887616e91a84bd5ecb39d0771155 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Sat, 6 Apr 2024 15:56:57 +0900 Subject: [PATCH] re-add update_file_entry MassFileLister.update_file_entry was accidentally removed in https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/15205/files#diff-c39b942d8f8620d46d314db8301189b8d6195fc97aedbeb124a33694b738d69cL151-R173 --- modules/util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/util.py b/modules/util.py index b6e6010c9..0db13736c 100644 --- a/modules/util.py +++ b/modules/util.py @@ -148,6 +148,11 @@ class MassFileLister: """Clear the cache of all directories.""" self.cached_dirs.clear() + def update_file_entry(self, path): + """Update the cache for a specific directory.""" + dirname, filename = os.path.split(path) + if cached_dir := self.cached_dirs.get(dirname): + cached_dir.update_entry(filename) def topological_sort(dependencies): """Accepts a dictionary mapping name to its dependencies, returns a list of names ordered according to dependencies. -- GitLab