From d76673e62da882c5974105af024a68b4c705f467 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 11 Jul 2024 23:12:51 +0200 Subject: [PATCH] use correct mtime for folder thumbs; mtime the file that was used to produce the folder thumbnail (rather than the folder itself) since the folder-thumb is always resolved to the file's thumb in the on-disk cache --- copyparty/httpcli.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 47affc79..e44d3dc7 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -4287,18 +4287,21 @@ class HttpCli(object): if cfn: fn = cfn[0] fp = os.path.join(abspath, fn) - if bos.path.exists(fp): - vrem = "{}/{}".format(vrem, fn).strip("/") - is_dir = False + st = bos.stat(fp) + vrem = "{}/{}".format(vrem, fn).strip("/") + is_dir = False except: pass else: for fn in self.args.th_covers: fp = os.path.join(abspath, fn) - if bos.path.exists(fp): + try: + st = bos.stat(fp) vrem = "{}/{}".format(vrem, fn).strip("/") is_dir = False break + except: + pass if is_dir: return self.tx_svg("folder")