Recognize replaced automation files and update secure watcher for 2.1.53
CI / verify (push) Canceled after 0s
CI / verify (push) Canceled after 0s
This commit is contained in:
1 parent
f2e400c89e
commit
d19d7faa19
9 files changed
+89
-178
No files matched your search
@@ -16,5 +16,8 @@ jobs:
|
|||||||
node-version: 24
|
node-version: 24
|
||||||
cache: npm
|
cache: npm
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run verify
|
- name: Lint application sources
|
||||||
|
run: npm run lint
|
||||||
|
- name: Audit production dependencies
|
||||||
|
run: npm audit --omit=dev
|
||||||
- run: npm run dist
|
- run: npm run dist
|
||||||
@@ -16,5 +16,8 @@ jobs:
|
|||||||
node-version: 24
|
node-version: 24
|
||||||
cache: npm
|
cache: npm
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run verify
|
- name: Lint application sources
|
||||||
|
run: npm run lint
|
||||||
|
- name: Audit production dependencies
|
||||||
|
run: npm audit --omit=dev
|
||||||
- run: npm run dist
|
- run: npm run dist
|
||||||
@@ -170,6 +170,7 @@
|
|||||||
return {
|
return {
|
||||||
path,
|
path,
|
||||||
size,
|
size,
|
||||||
|
...(typeof row.fileIdentity === 'string' && row.fileIdentity ? { fileIdentity: row.fileIdentity } : {}),
|
||||||
mtimeMs: Math.trunc(mtimeMs),
|
mtimeMs: Math.trunc(mtimeMs),
|
||||||
hoster,
|
hoster,
|
||||||
completedAt: Number.isFinite(completedAt) && completedAt >= 0 ? Math.trunc(completedAt) : 0
|
completedAt: Number.isFinite(completedAt) && completedAt >= 0 ? Math.trunc(completedAt) : 0
|
||||||
@@ -230,7 +231,7 @@
|
|||||||
const remaining = [];
|
const remaining = [];
|
||||||
for (const hoster of hosters) {
|
for (const hoster of hosters) {
|
||||||
const row = rows.get(`${normalizePath(path)}\u0000${hoster}`);
|
const row = rows.get(`${normalizePath(path)}\u0000${hoster}`);
|
||||||
if (row && Number.isFinite(size) && size === row.size && Number.isFinite(mtimeMs) && Math.trunc(mtimeMs) === row.mtimeMs) completed.push(hoster);
|
if (row && (!candidate.fileIdentity || candidate.fileIdentity === row.fileIdentity) && Number.isFinite(size) && size === row.size && Number.isFinite(mtimeMs) && Math.trunc(mtimeMs) === row.mtimeMs) completed.push(hoster);
|
||||||
else remaining.push(hoster);
|
else remaining.push(hoster);
|
||||||
}
|
}
|
||||||
if (hosters.length > 0 && remaining.length === 0) processedPaths.push(path);
|
if (hosters.length > 0 && remaining.length === 0) processedPaths.push(path);
|
||||||
@@ -316,11 +317,11 @@
|
|||||||
if (exact && queuePaths.has(exact)) {
|
if (exact && queuePaths.has(exact)) {
|
||||||
processedPaths.push(candidate?.path);
|
processedPaths.push(candidate?.path);
|
||||||
reasons[exact] = 'in-queue';
|
reasons[exact] = 'in-queue';
|
||||||
} else if ((exact && exactPaths.has(exact)) || (evidenceNames.has(name) && nameCounts.get(name) === 1)) {
|
} else if (!candidate.fileIdentity && ((exact && exactPaths.has(exact)) || (evidenceNames.has(name) && nameCounts.get(name) === 1))) {
|
||||||
processedPaths.push(candidate?.path);
|
processedPaths.push(candidate?.path);
|
||||||
reasons[exact] = exactPaths.has(exact) || historyNames.has(name) ? 'history' : 'upload-log';
|
reasons[exact] = exactPaths.has(exact) || historyNames.has(name) ? 'history' : 'upload-log';
|
||||||
}
|
}
|
||||||
else if (evidenceNames.has(name) && nameCounts.get(name) > 1) ambiguousPaths.push(candidate?.path);
|
else if (!candidate.fileIdentity && evidenceNames.has(name) && nameCounts.get(name) > 1) ambiguousPaths.push(candidate?.path);
|
||||||
else unprocessedPaths.push(candidate?.path);
|
else unprocessedPaths.push(candidate?.path);
|
||||||
}
|
}
|
||||||
return { processedPaths, ambiguousPaths, unprocessedPaths, reasons };
|
return { processedPaths, ambiguousPaths, unprocessedPaths, reasons };
|
||||||
|
|||||||
@@ -192,6 +192,11 @@ class FolderMonitor extends EventEmitter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
this._watcher.on('add', (filePath) => this._onNewFile(filePath, generation));
|
this._watcher.on('add', (filePath) => this._onNewFile(filePath, generation));
|
||||||
|
this._watcher.on('change', (filePath) => {
|
||||||
|
if (!this._acceptCallback(generation)) return;
|
||||||
|
this._seenFiles.delete(this._normalizePath(filePath));
|
||||||
|
this._onNewFile(filePath, generation);
|
||||||
|
});
|
||||||
this._watcher.on('unlink', (filePath) => {
|
this._watcher.on('unlink', (filePath) => {
|
||||||
if (this._acceptCallback(generation)) this._seenFiles.delete(this._normalizePath(filePath));
|
if (this._acceptCallback(generation)) this._seenFiles.delete(this._normalizePath(filePath));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -64,7 +64,10 @@
|
|||||||
fileHandle = await openPath(filePath, 'r');
|
fileHandle = await openPath(filePath, 'r');
|
||||||
const fileStat = await fileHandle.stat();
|
const fileStat = await fileHandle.stat();
|
||||||
if (!fileStat.isFile()) return { exists: true, readable: false, size: fileStat.size, mtimeMs: fileStat.mtimeMs };
|
if (!fileStat.isFile()) return { exists: true, readable: false, size: fileStat.size, mtimeMs: fileStat.mtimeMs };
|
||||||
return { exists: true, readable: true, size: fileStat.size, mtimeMs: fileStat.mtimeMs };
|
const identityParts = [fileStat.dev, fileStat.ino, fileStat.birthtimeMs, fileStat.ctimeMs];
|
||||||
|
const fileIdentity = identityParts.every(value => typeof value === 'number' && Number.isFinite(value))
|
||||||
|
? `v1:${identityParts.join(':')}` : '';
|
||||||
|
return { exists: true, readable: true, size: fileStat.size, mtimeMs: fileStat.mtimeMs, ...(fileIdentity ? { fileIdentity } : {}) };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error && (error.code === 'ENOENT' || error.code === 'ENOTDIR')) return { exists: false };
|
if (error && (error.code === 'ENOENT' || error.code === 'ENOTDIR')) return { exists: false };
|
||||||
return { exists: true, readable: false };
|
return { exists: true, readable: false };
|
||||||
@@ -112,7 +115,7 @@
|
|||||||
const reason = unavailableReason(result);
|
const reason = unavailableReason(result);
|
||||||
const mtimeMs = Number.isFinite(Number(result?.mtimeMs)) ? Number(result.mtimeMs) : entry.mtimeMs;
|
const mtimeMs = Number.isFinite(Number(result?.mtimeMs)) ? Number(result.mtimeMs) : entry.mtimeMs;
|
||||||
if (reason) return { entry: { ...entry, size: Number(result?.size) || 0, mtimeMs }, reason };
|
if (reason) return { entry: { ...entry, size: Number(result?.size) || 0, mtimeMs }, reason };
|
||||||
return { entry: { ...entry, size: Number(result.size), mtimeMs }, reason: '' };
|
return { entry: { ...entry, size: Number(result.size), mtimeMs, ...(result.fileIdentity ? { fileIdentity: result.fileIdentity } : {}) }, reason: '' };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return { entry, reason: error && error.code === 'ENOENT' ? 'missing' : 'unreadable' };
|
return { entry, reason: error && error.code === 'ENOENT' ? 'missing' : 'unreadable' };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1256,6 +1256,7 @@ async function registerAutomationCompletionJobs(manager, jobs) {
|
|||||||
const sourceMtimeMs = job.sourceMtimeMs ?? job.automationMtimeMs;
|
const sourceMtimeMs = job.sourceMtimeMs ?? job.automationMtimeMs;
|
||||||
let size = hasFiniteMetadata(sourceSize) ? Number(sourceSize) : Number.NaN;
|
let size = hasFiniteMetadata(sourceSize) ? Number(sourceSize) : Number.NaN;
|
||||||
let mtimeMs = hasFiniteMetadata(sourceMtimeMs) ? Number(sourceMtimeMs) : Number.NaN;
|
let mtimeMs = hasFiniteMetadata(sourceMtimeMs) ? Number(sourceMtimeMs) : Number.NaN;
|
||||||
|
const fileIdentity = job.sourceFileIdentity || '';
|
||||||
if (!Number.isFinite(size) || !Number.isFinite(mtimeMs)) {
|
if (!Number.isFinite(size) || !Number.isFinite(mtimeMs)) {
|
||||||
try {
|
try {
|
||||||
const stat = await fs.promises.stat(job.file);
|
const stat = await fs.promises.stat(job.file);
|
||||||
@@ -1268,6 +1269,7 @@ async function registerAutomationCompletionJobs(manager, jobs) {
|
|||||||
path: job.file,
|
path: job.file,
|
||||||
size,
|
size,
|
||||||
mtimeMs,
|
mtimeMs,
|
||||||
|
...(fileIdentity ? { fileIdentity } : {}),
|
||||||
hoster: job.hoster
|
hoster: job.hoster
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+18
-153
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "2.1.52",
|
"version": "2.1.53",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "2.1.52",
|
"version": "2.1.53",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": "^3.6.0",
|
"chokidar": "^4.0.3",
|
||||||
"undici": "7.29.1",
|
"undici": "7.29.1",
|
||||||
"ws": "^8.21.3"
|
"ws": "^8.21.3"
|
||||||
},
|
},
|
||||||
@@ -836,19 +836,6 @@
|
|||||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/anymatch": {
|
|
||||||
"version": "3.1.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
|
|
||||||
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"normalize-path": "^3.0.0",
|
|
||||||
"picomatch": "^2.0.4"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/app-builder-lib": {
|
"node_modules/app-builder-lib": {
|
||||||
"version": "26.15.3",
|
"version": "26.15.3",
|
||||||
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-26.15.3.tgz",
|
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-26.15.3.tgz",
|
||||||
@@ -1172,18 +1159,6 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/binary-extensions": {
|
|
||||||
"version": "2.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
|
|
||||||
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/bluebird": {
|
"node_modules/bluebird": {
|
||||||
"version": "3.7.2",
|
"version": "3.7.2",
|
||||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||||
@@ -1213,18 +1188,6 @@
|
|||||||
"node": "20 || >=22"
|
"node": "20 || >=22"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/braces": {
|
|
||||||
"version": "3.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
|
||||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"fill-range": "^7.1.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/buffer-from": {
|
"node_modules/buffer-from": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
||||||
@@ -1343,27 +1306,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chokidar": {
|
"node_modules/chokidar": {
|
||||||
"version": "3.6.0",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
|
||||||
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
|
"integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"anymatch": "~3.1.2",
|
"readdirp": "^4.0.1"
|
||||||
"braces": "~3.0.2",
|
|
||||||
"glob-parent": "~5.1.2",
|
|
||||||
"is-binary-path": "~2.1.0",
|
|
||||||
"is-glob": "~4.0.1",
|
|
||||||
"normalize-path": "~3.0.0",
|
|
||||||
"readdirp": "~3.6.0"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.10.0"
|
"node": ">= 14.16.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://paulmillr.com/funding/"
|
"url": "https://paulmillr.com/funding/"
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"fsevents": "~2.3.2"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chownr": {
|
"node_modules/chownr": {
|
||||||
@@ -2362,18 +2316,6 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fill-range": {
|
|
||||||
"version": "7.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
|
||||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"to-regex-range": "^5.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/find-up": {
|
"node_modules/find-up": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
|
||||||
@@ -2451,20 +2393,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/fsevents": {
|
|
||||||
"version": "2.3.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
|
||||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"darwin"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/function-bind": {
|
"node_modules/function-bind": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||||
@@ -2562,18 +2490,6 @@
|
|||||||
"url": "https://github.com/sponsors/isaacs"
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/glob-parent": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"is-glob": "^4.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/glob/node_modules/balanced-match": {
|
"node_modules/glob/node_modules/balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
@@ -2855,18 +2771,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/is-binary-path": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"binary-extensions": "^2.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/is-docker": {
|
"node_modules/is-docker": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
|
||||||
@@ -2887,6 +2791,7 @@
|
|||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||||
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
|
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
@@ -2906,6 +2811,7 @@
|
|||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
||||||
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-extglob": "^2.1.1"
|
"is-extglob": "^2.1.1"
|
||||||
@@ -2914,15 +2820,6 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/is-number": {
|
|
||||||
"version": "7.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.12.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/is-wsl": {
|
"node_modules/is-wsl": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
|
||||||
@@ -3410,15 +3307,6 @@
|
|||||||
"node": "^20.17.0 || >=22.9.0"
|
"node": "^20.17.0 || >=22.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/normalize-path": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/normalize-url": {
|
"node_modules/normalize-url": {
|
||||||
"version": "6.1.0",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz",
|
||||||
@@ -3565,18 +3453,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/picomatch": {
|
|
||||||
"version": "2.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
|
||||||
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.6"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/pkijs": {
|
"node_modules/pkijs": {
|
||||||
"version": "3.4.0",
|
"version": "3.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.4.0.tgz",
|
||||||
@@ -3813,15 +3689,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/readdirp": {
|
"node_modules/readdirp": {
|
||||||
"version": "3.6.0",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
|
||||||
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
|
"integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
|
||||||
"picomatch": "^2.2.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.10.0"
|
"node": ">= 14.18.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://paulmillr.com/funding/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/regexp-tree": {
|
"node_modules/regexp-tree": {
|
||||||
@@ -4298,18 +4175,6 @@
|
|||||||
"tmp": "^0.2.0"
|
"tmp": "^0.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/to-regex-range": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"is-number": "^7.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/truncate-utf8-bytes": {
|
"node_modules/truncate-utf8-bytes": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "2.1.52",
|
"version": "2.1.53",
|
||||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"release:win": "electron-builder --publish never --win nsis portable"
|
"release:win": "electron-builder --publish never --win nsis portable"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": "^3.6.0",
|
"chokidar": "^4.0.3",
|
||||||
"undici": "7.29.1",
|
"undici": "7.29.1",
|
||||||
"ws": "^8.21.3"
|
"ws": "^8.21.3"
|
||||||
},
|
},
|
||||||
|
|||||||
+45
-16
@@ -697,6 +697,13 @@ async function loadReusableAutomationEvidenceSnapshot() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function automationBlockingPaths(candidates) {
|
||||||
|
const identities = new Map(candidates.map(file => [normalizeAutomationPath(file.path), file.fileIdentity]));
|
||||||
|
const blocks = (path, identity, terminal) => !terminal || !identities.get(normalizeAutomationPath(path)) || identity === identities.get(normalizeAutomationPath(path));
|
||||||
|
return [...queueJobs.filter(job => blocks(job.file, job.sourceFileIdentity, ['done', 'error', 'skipped', 'aborted'].includes(job.status))).map(job => job.file),
|
||||||
|
...selectedFiles.filter(file => blocks(file.path, file.fileIdentity, true)).map(file => file.path)];
|
||||||
|
}
|
||||||
|
|
||||||
async function evaluateAutomationCandidates(files, options = {}) {
|
async function evaluateAutomationCandidates(files, options = {}) {
|
||||||
const source = Array.isArray(files) ? files : [];
|
const source = Array.isArray(files) ? files : [];
|
||||||
const normalizedCandidates = source.map(normalizeAutomationCandidate);
|
const normalizedCandidates = source.map(normalizeAutomationCandidate);
|
||||||
@@ -716,31 +723,32 @@ async function evaluateAutomationCandidates(files, options = {}) {
|
|||||||
.map(value => String(value || '').trim())
|
.map(value => String(value || '').trim())
|
||||||
.filter(Boolean)));
|
.filter(Boolean)));
|
||||||
const { history, uploadLog, automationCompletions } = options.evidenceSnapshot || await loadAutomationEvidenceSnapshot();
|
const { history, uploadLog, automationCompletions } = options.evidenceSnapshot || await loadAutomationEvidenceSnapshot();
|
||||||
const currentPaths = new Set([...queueJobs.map(job => job.file), ...selectedFiles.map(file => file.path)].map(normalizeAutomationPath));
|
const inspection = await window.api.inspectImportFiles(
|
||||||
|
matched,
|
||||||
|
_pendingFiles.filter(file => !ownedPendingPaths.has(normalizeAutomationPath(file.path))).map(file => file.path)
|
||||||
|
);
|
||||||
|
const inspectedCandidates = Array.isArray(inspection?.accepted) ? inspection.accepted : [];
|
||||||
|
const blockingPaths = automationBlockingPaths(inspectedCandidates);
|
||||||
|
const currentPaths = new Set(blockingPaths.map(normalizeAutomationPath));
|
||||||
const durableCompletionPaths = new Set((Array.isArray(automationCompletions) ? automationCompletions : []).map(row => normalizeAutomationPath(row?.path)).filter(Boolean));
|
const durableCompletionPaths = new Set((Array.isArray(automationCompletions) ? automationCompletions : []).map(row => normalizeAutomationPath(row?.path)).filter(Boolean));
|
||||||
const legacyCandidates = matched.filter(candidate => {
|
const legacyCandidates = inspectedCandidates.filter(candidate => {
|
||||||
const key = normalizeAutomationPath(candidate.path);
|
const key = normalizeAutomationPath(candidate.path);
|
||||||
return currentPaths.has(key) || !durableCompletionPaths.has(key);
|
return currentPaths.has(key) || !durableCompletionPaths.has(key);
|
||||||
});
|
});
|
||||||
const processed = window.AutomationControl.classifyProcessedCandidates({
|
const processed = window.AutomationControl.classifyProcessedCandidates({
|
||||||
candidates: legacyCandidates,
|
candidates: legacyCandidates,
|
||||||
queuePaths: [...queueJobs.map(job => job.file), ...selectedFiles.map(file => file.path)],
|
queuePaths: blockingPaths,
|
||||||
historyRows: flattenAutomationHistoryRows(history),
|
historyRows: flattenAutomationHistoryRows(history),
|
||||||
uploadLogRows: uploadLog
|
uploadLogRows: uploadLog
|
||||||
});
|
});
|
||||||
const processedPaths = new Set(processed.processedPaths.map(normalizeAutomationPath));
|
const processedPaths = new Set(processed.processedPaths.map(normalizeAutomationPath));
|
||||||
for (const path of processedPaths) reasons.set(path, processed.reasons[path] || 'processed');
|
for (const path of processedPaths) reasons.set(path, processed.reasons[path] || 'processed');
|
||||||
const unprocessed = matched.filter(candidate => !processedPaths.has(normalizeAutomationPath(candidate.path)));
|
const metadata = new Map(matched.map(candidate => [normalizeAutomationPath(candidate.path), candidate]));
|
||||||
const inspection = await window.api.inspectImportFiles(
|
|
||||||
unprocessed,
|
|
||||||
_pendingFiles.filter(file => !ownedPendingPaths.has(normalizeAutomationPath(file.path))).map(file => file.path)
|
|
||||||
);
|
|
||||||
const metadata = new Map(unprocessed.map(candidate => [normalizeAutomationPath(candidate.path), candidate]));
|
|
||||||
const inspectionDuplicatePaths = new Set((Array.isArray(inspection?.duplicates) ? inspection.duplicates : []).map(file => normalizeAutomationPath(file?.path)).filter(Boolean));
|
const inspectionDuplicatePaths = new Set((Array.isArray(inspection?.duplicates) ? inspection.duplicates : []).map(file => normalizeAutomationPath(file?.path)).filter(Boolean));
|
||||||
const unavailablePaths = new Set((Array.isArray(inspection?.unavailable) ? inspection.unavailable : []).map(file => normalizeAutomationPath(file?.path)).filter(Boolean));
|
const unavailablePaths = new Set((Array.isArray(inspection?.unavailable) ? inspection.unavailable : []).map(file => normalizeAutomationPath(file?.path)).filter(Boolean));
|
||||||
for (const path of inspectionDuplicatePaths) reasons.set(path, 'inspection-duplicate');
|
for (const path of inspectionDuplicatePaths) reasons.set(path, 'inspection-duplicate');
|
||||||
for (const path of unavailablePaths) reasons.set(path, 'unavailable');
|
for (const path of unavailablePaths) reasons.set(path, 'unavailable');
|
||||||
const accepted = (Array.isArray(inspection?.accepted) ? inspection.accepted : []).map(file => ({
|
const accepted = inspectedCandidates.filter(file => !processedPaths.has(normalizeAutomationPath(file.path))).map(file => ({
|
||||||
...(metadata.get(normalizeAutomationPath(file?.path)) || {}),
|
...(metadata.get(normalizeAutomationPath(file?.path)) || {}),
|
||||||
...file
|
...file
|
||||||
}));
|
}));
|
||||||
@@ -751,6 +759,7 @@ async function evaluateAutomationCandidates(files, options = {}) {
|
|||||||
name: file.name,
|
name: file.name,
|
||||||
size: file.size,
|
size: file.size,
|
||||||
mtimeMs: file.mtimeMs,
|
mtimeMs: file.mtimeMs,
|
||||||
|
fileIdentity: file.fileIdentity,
|
||||||
eligibleHosters,
|
eligibleHosters,
|
||||||
eligibleJobCount: eligibleHosters.length
|
eligibleJobCount: eligibleHosters.length
|
||||||
};
|
};
|
||||||
@@ -865,6 +874,7 @@ function createAutomationPreviewJob(file, hoster) {
|
|||||||
automationMtimeMs: file.mtimeMs,
|
automationMtimeMs: file.mtimeMs,
|
||||||
automationSize: file.size,
|
automationSize: file.size,
|
||||||
sourceMtimeMs: file.mtimeMs,
|
sourceMtimeMs: file.mtimeMs,
|
||||||
|
sourceFileIdentity: file.fileIdentity,
|
||||||
sourceSize: file.size,
|
sourceSize: file.size,
|
||||||
automationAdmission: true
|
automationAdmission: true
|
||||||
};
|
};
|
||||||
@@ -910,6 +920,7 @@ async function applyAutomationEvaluation(evaluation) {
|
|||||||
name: file.name,
|
name: file.name,
|
||||||
size: file.size,
|
size: file.size,
|
||||||
mtimeMs: file.mtimeMs,
|
mtimeMs: file.mtimeMs,
|
||||||
|
fileIdentity: file.fileIdentity,
|
||||||
eligibleHosters,
|
eligibleHosters,
|
||||||
eligibleJobCount: eligibleHosters.length,
|
eligibleJobCount: eligibleHosters.length,
|
||||||
completedHosters: [...completedHosters]
|
completedHosters: [...completedHosters]
|
||||||
@@ -917,14 +928,13 @@ async function applyAutomationEvaluation(evaluation) {
|
|||||||
});
|
});
|
||||||
const ownedPendingPaths = new Set(Array.isArray(evaluation.ownedPendingPaths) ? evaluation.ownedPendingPaths : []);
|
const ownedPendingPaths = new Set(Array.isArray(evaluation.ownedPendingPaths) ? evaluation.ownedPendingPaths : []);
|
||||||
const currentPaths = new Set([
|
const currentPaths = new Set([
|
||||||
...queueJobs.map(job => job.file),
|
...automationBlockingPaths(replannedCandidates),
|
||||||
...selectedFiles.map(file => file.path),
|
|
||||||
..._pendingFiles.filter(file => !ownedPendingPaths.has(normalizeAutomationPath(file.path))).map(file => file.path)
|
..._pendingFiles.filter(file => !ownedPendingPaths.has(normalizeAutomationPath(file.path))).map(file => file.path)
|
||||||
].map(normalizeAutomationPath));
|
].map(normalizeAutomationPath));
|
||||||
const candidates = replannedCandidates.filter(candidate => !currentPaths.has(normalizeAutomationPath(candidate.path)));
|
const candidates = replannedCandidates.filter(candidate => !currentPaths.has(normalizeAutomationPath(candidate.path)));
|
||||||
if (selectedHosters.length === 0) {
|
if (selectedHosters.length === 0) {
|
||||||
if (candidates.length > 0) {
|
if (candidates.length > 0) {
|
||||||
_pendingFiles.push(...candidates.map(file => ({ path: file.path, name: file.name, size: file.size, mtimeMs: file.mtimeMs })));
|
_pendingFiles.push(...candidates.map(file => ({ path: file.path, name: file.name, size: file.size, mtimeMs: file.mtimeMs, fileIdentity: file.fileIdentity })));
|
||||||
mergePendingImportInspection({
|
mergePendingImportInspection({
|
||||||
candidateCount: evaluation.summary.filterMatched,
|
candidateCount: evaluation.summary.filterMatched,
|
||||||
duplicateCount: evaluation.summary.alreadyProcessed,
|
duplicateCount: evaluation.summary.alreadyProcessed,
|
||||||
@@ -983,6 +993,16 @@ async function applyAutomationEvaluation(evaluation) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
const newJobs = admittedFiles.flatMap(file => file.eligibleHosters.map(hoster => createAutomationPreviewJob(file, hoster)));
|
const newJobs = admittedFiles.flatMap(file => file.eligibleHosters.map(hoster => createAutomationPreviewJob(file, hoster)));
|
||||||
|
for (const file of admittedFiles) {
|
||||||
|
if (!file.fileIdentity) continue;
|
||||||
|
const key = normalizeAutomationPath(file.path);
|
||||||
|
queueJobs = queueJobs.filter(job => normalizeAutomationPath(job.file) !== key || job.sourceFileIdentity === file.fileIdentity);
|
||||||
|
selectedFiles = selectedFiles.filter(entry => normalizeAutomationPath(entry.path) !== key || entry.fileIdentity === file.fileIdentity);
|
||||||
|
for (const hoster of file.eligibleHosters) {
|
||||||
|
_completedUploadKeys.delete(`${file.path}|${hoster}`);
|
||||||
|
_suppressedPreviewKeys.delete(`${file.path}|${hoster}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
queueJobs.push(...newJobs);
|
queueJobs.push(...newJobs);
|
||||||
rebuildJobIndex();
|
rebuildJobIndex();
|
||||||
_queueStatsCache = null;
|
_queueStatsCache = null;
|
||||||
@@ -2354,6 +2374,7 @@ function restoreQueueStateFromConfig() {
|
|||||||
path: file.path,
|
path: file.path,
|
||||||
name: file.name || file.path.split(/[\\/]/).pop(),
|
name: file.name || file.path.split(/[\\/]/).pop(),
|
||||||
size: file.size || 0,
|
size: file.size || 0,
|
||||||
|
fileIdentity: file.fileIdentity,
|
||||||
mtimeMs: Number.isFinite(Number(file.mtimeMs)) ? Number(file.mtimeMs) : null
|
mtimeMs: Number.isFinite(Number(file.mtimeMs)) ? Number(file.mtimeMs) : null
|
||||||
}))
|
}))
|
||||||
: [];
|
: [];
|
||||||
@@ -2383,6 +2404,7 @@ function restoreQueueStateFromConfig() {
|
|||||||
sourceCleanupCompletedHosters: Array.isArray(job.sourceCleanupCompletedHosters) ? [...job.sourceCleanupCompletedHosters] : [],
|
sourceCleanupCompletedHosters: Array.isArray(job.sourceCleanupCompletedHosters) ? [...job.sourceCleanupCompletedHosters] : [],
|
||||||
sourceCleanupFingerprint: job.sourceCleanupFingerprint || null,
|
sourceCleanupFingerprint: job.sourceCleanupFingerprint || null,
|
||||||
automationAdmission: job.automationAdmission === true,
|
automationAdmission: job.automationAdmission === true,
|
||||||
|
sourceFileIdentity: job.sourceFileIdentity,
|
||||||
automationMtimeMs: Number.isFinite(Number(job.automationMtimeMs)) ? Number(job.automationMtimeMs) : null,
|
automationMtimeMs: Number.isFinite(Number(job.automationMtimeMs)) ? Number(job.automationMtimeMs) : null,
|
||||||
automationSize: Number.isFinite(Number(job.automationSize)) ? Number(job.automationSize) : null,
|
automationSize: Number.isFinite(Number(job.automationSize)) ? Number(job.automationSize) : null,
|
||||||
sourceMtimeMs: Number.isFinite(Number(job.sourceMtimeMs)) ? Number(job.sourceMtimeMs) : null,
|
sourceMtimeMs: Number.isFinite(Number(job.sourceMtimeMs)) ? Number(job.sourceMtimeMs) : null,
|
||||||
@@ -2419,6 +2441,7 @@ function buildPersistedQueueState() {
|
|||||||
path: job.file,
|
path: job.file,
|
||||||
name: job.fileName,
|
name: job.fileName,
|
||||||
size: job.sourceSize ?? job.automationSize ?? job.bytesTotal ?? 0,
|
size: job.sourceSize ?? job.automationSize ?? job.bytesTotal ?? 0,
|
||||||
|
fileIdentity: job.sourceFileIdentity,
|
||||||
mtimeMs: job.sourceMtimeMs ?? job.automationMtimeMs ?? null
|
mtimeMs: job.sourceMtimeMs ?? job.automationMtimeMs ?? null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -2468,6 +2491,7 @@ function buildPersistedQueueState() {
|
|||||||
sourceCleanupCompletedHosters: Array.isArray(job.sourceCleanupCompletedHosters) ? [...job.sourceCleanupCompletedHosters] : [],
|
sourceCleanupCompletedHosters: Array.isArray(job.sourceCleanupCompletedHosters) ? [...job.sourceCleanupCompletedHosters] : [],
|
||||||
sourceCleanupFingerprint: job.sourceCleanupFingerprint || null,
|
sourceCleanupFingerprint: job.sourceCleanupFingerprint || null,
|
||||||
automationAdmission: job.automationAdmission === true,
|
automationAdmission: job.automationAdmission === true,
|
||||||
|
sourceFileIdentity: job.sourceFileIdentity,
|
||||||
automationMtimeMs: Number.isFinite(Number(job.automationMtimeMs)) ? Number(job.automationMtimeMs) : null,
|
automationMtimeMs: Number.isFinite(Number(job.automationMtimeMs)) ? Number(job.automationMtimeMs) : null,
|
||||||
automationSize: Number.isFinite(Number(job.automationSize)) ? Number(job.automationSize) : null,
|
automationSize: Number.isFinite(Number(job.automationSize)) ? Number(job.automationSize) : null,
|
||||||
sourceMtimeMs: Number.isFinite(Number(job.sourceMtimeMs)) ? Number(job.sourceMtimeMs) : null,
|
sourceMtimeMs: Number.isFinite(Number(job.sourceMtimeMs)) ? Number(job.sourceMtimeMs) : null,
|
||||||
@@ -2873,6 +2897,7 @@ function buildQueuePreview() {
|
|||||||
file: file.path, fileName: file.name, hoster,
|
file: file.path, fileName: file.name, hoster,
|
||||||
status: 'preview', bytesUploaded: 0, bytesTotal: file.size || 0,
|
status: 'preview', bytesUploaded: 0, bytesTotal: file.size || 0,
|
||||||
sourceMtimeMs: file.mtimeMs,
|
sourceMtimeMs: file.mtimeMs,
|
||||||
|
sourceFileIdentity: file.fileIdentity,
|
||||||
sourceSize: file.size,
|
sourceSize: file.size,
|
||||||
speedKbs: 0, elapsed: 0, remaining: 0,
|
speedKbs: 0, elapsed: 0, remaining: 0,
|
||||||
error: null, result: null, attempt: 0, maxAttempts: 0, link: ''
|
error: null, result: null, attempt: 0, maxAttempts: 0, link: ''
|
||||||
@@ -4559,6 +4584,7 @@ function serializeUploadJob(job) {
|
|||||||
automationMtimeMs: job.automationMtimeMs,
|
automationMtimeMs: job.automationMtimeMs,
|
||||||
automationSize: job.automationSize,
|
automationSize: job.automationSize,
|
||||||
sourceMtimeMs: job.sourceMtimeMs,
|
sourceMtimeMs: job.sourceMtimeMs,
|
||||||
|
sourceFileIdentity: job.sourceFileIdentity,
|
||||||
sourceSize: job.sourceSize
|
sourceSize: job.sourceSize
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -5648,6 +5674,7 @@ function syncSelectedFilesFromQueue() {
|
|||||||
path: job.file,
|
path: job.file,
|
||||||
name: job.fileName,
|
name: job.fileName,
|
||||||
size: job.sourceSize ?? job.automationSize ?? job.bytesTotal ?? 0,
|
size: job.sourceSize ?? job.automationSize ?? job.bytesTotal ?? 0,
|
||||||
|
fileIdentity: job.sourceFileIdentity,
|
||||||
mtimeMs: job.sourceMtimeMs ?? job.automationMtimeMs ?? null
|
mtimeMs: job.sourceMtimeMs ?? job.automationMtimeMs ?? null
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -10071,6 +10098,7 @@ async function _autoDeduplicateFromLog() {
|
|||||||
path: job.file,
|
path: job.file,
|
||||||
size: job.sourceSize ?? job.automationSize ?? job.bytesTotal,
|
size: job.sourceSize ?? job.automationSize ?? job.bytesTotal,
|
||||||
mtimeMs: job.sourceMtimeMs ?? job.automationMtimeMs,
|
mtimeMs: job.sourceMtimeMs ?? job.automationMtimeMs,
|
||||||
|
fileIdentity: job.sourceFileIdentity,
|
||||||
eligibleHosters: [job.hoster]
|
eligibleHosters: [job.hoster]
|
||||||
}));
|
}));
|
||||||
const ledgerState = window.AutomationControl.classifyAutomationCompletionLedger({
|
const ledgerState = window.AutomationControl.classifyAutomationCompletionLedger({
|
||||||
@@ -10090,8 +10118,8 @@ async function _autoDeduplicateFromLog() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (Array.isArray(entries) && entries.length > 0) {
|
if (Array.isArray(entries) && entries.length > 0) {
|
||||||
const partitioned = window.QueueDedup.partitionRestoredJobsByLog(queueJobs, entries, _restoredSnapshotSavedAt);
|
const partitioned = window.QueueDedup.partitionRestoredJobsByLog(queueJobs.filter(job => !job.sourceFileIdentity), entries, _restoredSnapshotSavedAt);
|
||||||
queueJobs = partitioned.kept;
|
queueJobs = queueJobs.filter(job => job.sourceFileIdentity).concat(partitioned.kept);
|
||||||
removed.push(...partitioned.removed);
|
removed.push(...partitioned.removed);
|
||||||
}
|
}
|
||||||
for (const job of removed) {
|
for (const job of removed) {
|
||||||
@@ -10102,6 +10130,7 @@ async function _autoDeduplicateFromLog() {
|
|||||||
path: file.path,
|
path: file.path,
|
||||||
size: file.size,
|
size: file.size,
|
||||||
mtimeMs: file.mtimeMs,
|
mtimeMs: file.mtimeMs,
|
||||||
|
fileIdentity: file.fileIdentity,
|
||||||
eligibleHosters: getSelectedHosters()
|
eligibleHosters: getSelectedHosters()
|
||||||
})),
|
})),
|
||||||
completionRows
|
completionRows
|
||||||
@@ -10115,7 +10144,7 @@ async function _autoDeduplicateFromLog() {
|
|||||||
window.api.debugLog(`auto-dedup: removed ${removed.length} completed jobs from restored queue`);
|
window.api.debugLog(`auto-dedup: removed ${removed.length} completed jobs from restored queue`);
|
||||||
}
|
}
|
||||||
if (Array.isArray(entries) && entries.length > 0) {
|
if (Array.isArray(entries) && entries.length > 0) {
|
||||||
const seedKeys = window.QueueDedup.completedSelectionKeys(selectedFiles, getSelectedHosters(), entries, _restoredSnapshotSavedAt);
|
const seedKeys = window.QueueDedup.completedSelectionKeys(selectedFiles.filter(file => !file.fileIdentity), getSelectedHosters(), entries, _restoredSnapshotSavedAt);
|
||||||
if (seedKeys.length > 0) {
|
if (seedKeys.length > 0) {
|
||||||
for (const key of seedKeys) _completedUploadKeys.add(key);
|
for (const key of seedKeys) _completedUploadKeys.add(key);
|
||||||
window.api.debugLog(`auto-dedup: seeded ${seedKeys.length} completed file|hoster keys from log so buildQueuePreview won't re-create ghosts`);
|
window.api.debugLog(`auto-dedup: seeded ${seedKeys.length} completed file|hoster keys from log so buildQueuePreview won't re-create ghosts`);
|
||||||
|
|||||||
Reference in new issue
Block a user