From 5d6419610fb94d1a45794cad2cbfa3b3e02b547f Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 10 Sep 2026 18:30:14 +0200 Subject: [PATCH] Always key local image cache on full dest+path URL --- nomadnet/ui/textui/Browser.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/nomadnet/ui/textui/Browser.py b/nomadnet/ui/textui/Browser.py index edfa939..dc857ba 100644 --- a/nomadnet/ui/textui/Browser.py +++ b/nomadnet/ui/textui/Browser.py @@ -274,27 +274,22 @@ class Browser: else: RNS.log(f"In-browser image rendering is not supported", RNS.LOG_DEBUG) def current_url(self): - if self.destination_hash == None: - return "" + if self.destination_hash == None: return "" path = "" if self.path == None else self.path url = RNS.hexrep(self.destination_hash, delimit=False)+":"+path if isinstance(self.request_data, dict) and self.request_data: parts = [] for k, v in self.request_data.items(): - if not isinstance(k, str): - continue - if not k.startswith("var_"): - continue + if not isinstance(k, str): continue + if not k.startswith("var_"): continue parts.append(k[4:]+"="+str(v)) - if parts: - url += "`" + "|".join(parts) + if parts: url += "`" + "|".join(parts) return url def url_hash(self, url): - if url == None: - return None + if url == None: return None else: url = url.encode("utf-8") return RNS.hexrep(RNS.Identity.full_hash(url), delimit=False) @@ -756,6 +751,8 @@ class Browser: if self.page_list is not None: self.page_list.invalidate_layout() def image_cache_path(self, url): + destination_hash, path = self.parse_url(url) + url = f"{RNS.hexrep(destination_hash, delimit=False)}:{path}" url_hash = self.url_hash(url) if not url_hash: return None else: