From 4087f10345f4774eeba9c75cef7fedfffaa995be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Sun, 23 Aug 2026 10:39:16 +0300 Subject: [PATCH] =?UTF-8?q?v0.0.60:=20=D0=B4=D0=B5=D0=B4=D1=83=D0=BF=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D0=B8=D0=BC=D1=8F+=D1=80=D0=B0=D0=B7=D0=BC?= =?UTF-8?q?=D0=B5=D1=80=20(=D0=B4=D0=B0=D1=82=D1=83=20=D0=B8=D0=B3=D0=BD?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D1=80=D1=83=D0=B5=D0=BC)=20=E2=80=94=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D1=81=D0=BE=D0=B2=D0=BF=D0=B0=D0=B4=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B8=20=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D0=BC=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D1=81=D0=B2?= =?UTF-8?q?=D0=B5=D0=B6=D0=B8=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB,=20=D0=B4?= =?UTF-8?q?=D1=83=D0=B1=D0=BB=D1=8C=20=D0=B8=D0=B7=20=D0=B0=D1=80=D1=85?= =?UTF-8?q?=D0=B8=D0=B2=D0=B0/=D0=BF=D0=BE=D0=B2=D1=82=D0=BE=D1=80=D0=B0?= =?UTF-8?q?=20=D0=BD=D0=B5=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D1=91=D1=82=20?= =?UTF-8?q?=5F2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.py | 2 +- site/templates/index.html | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/site/app.py b/site/app.py index d296dce..950cd5e 100644 --- a/site/app.py +++ b/site/app.py @@ -21,7 +21,7 @@ if _sys_path_root not in sys.path: sys.path.insert(0, _sys_path_root) # Версия приложения (меняется при изменениях) -VERSION = "0.0.59" +VERSION = "0.0.60" def setup_logging(): diff --git a/site/templates/index.html b/site/templates/index.html index 625bd77..f58128f 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -349,7 +349,17 @@ function addFileWithDedup(file) { if (fileMeta.has(name)) { const e = fileMeta.get(name); - if (e.size === size && e.mtime === mtime) return; // точный дубль — пропустить + if (e.size === size) { + // Тот же файл (имя+размер) — дедуп. Дату не сравниваем: файл могли пересохранить + // с тем же содержимым. Оставляем более свежий по дате. + if (mtime > e.mtime) { + e.mtime = mtime; + const idx = sf.findIndex(f => f.name === name); + if (idx >= 0) sf[idx] = new File([file], name, { lastModified: mtime }); + } + return; + } + // Имя то же, размер другой — добавить с суффиксом _2, _3... const dot = name.lastIndexOf('.'); const base = dot > 0 ? name.slice(0, dot) : name; const ext = dot > 0 ? name.slice(dot) : '';