v0.0.69: архивы из папки не теряются — zip без документов добавляется как есть; раскрытие zip с документами; склонение счётчика
Deploy drhider / validate (push) Canceled after 0s
Deploy drhider / validate (push) Canceled after 0s
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ if _sys_path_root not in sys.path:
|
||||
sys.path.insert(0, _sys_path_root)
|
||||
|
||||
# Версия приложения (меняется при изменениях)
|
||||
VERSION = "0.0.68"
|
||||
VERSION = "0.0.69"
|
||||
|
||||
|
||||
def setup_logging():
|
||||
|
||||
@@ -555,7 +555,8 @@ fi.addEventListener('change', async () => {
|
||||
if (f.name.toLowerCase().endsWith('.zip')) {
|
||||
try {
|
||||
const nested = await listZipFiles(f);
|
||||
nested.forEach(x => addFileWithDedup(x));
|
||||
if (nested.length) nested.forEach(x => addFileWithDedup(x));
|
||||
else addFileWithDedup(f); // в архиве нет документов — добавить архив как есть
|
||||
} catch (err) {
|
||||
addFileWithDedup(f); // не удалось распаковать — добавить zip как есть
|
||||
}
|
||||
@@ -596,9 +597,15 @@ folderInput.addEventListener('change', async () => {
|
||||
if (low.endsWith('.zip')) {
|
||||
try {
|
||||
const nested = await listZipFiles(f);
|
||||
for (const nf of nested) {
|
||||
const nm = relDir ? relDir + '/' + nf.name : nf.name;
|
||||
addFileWithDedup(new File([nf], nm, { lastModified: nf.lastModified }));
|
||||
if (nested.length) {
|
||||
for (const nf of nested) {
|
||||
const nm = relDir ? relDir + '/' + nf.name : nf.name;
|
||||
addFileWithDedup(new File([nf], nm, { lastModified: nf.lastModified }));
|
||||
added++;
|
||||
}
|
||||
} else {
|
||||
// в архиве нет документов — добавить архив как есть, чтобы не терялся
|
||||
addFileWithDedup(new File([f], rel, { lastModified: f.lastModified }));
|
||||
added++;
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -616,7 +623,12 @@ folderInput.addEventListener('change', async () => {
|
||||
}
|
||||
folderInput.value = ''; // чтобы повторный выбор той же папки сработал
|
||||
rr();
|
||||
if (added) { st.className = 'status done'; st.textContent = '✅ Добавлено из папки: ' + added + ' файлов'; }
|
||||
if (added) {
|
||||
st.className = 'status done';
|
||||
const n = added;
|
||||
const w = (n % 10 === 1 && n % 100 !== 11) ? 'файл' : (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 'файла' : 'файлов';
|
||||
st.textContent = '✅ Добавлено из папки: ' + n + ' ' + w;
|
||||
}
|
||||
});
|
||||
|
||||
function ss(idx, h) { const e = document.getElementById('st-' + idx); if (e) e.innerHTML = h; }
|
||||
|
||||
Reference in New Issue
Block a user