.
This commit is contained in:
@@ -271,16 +271,32 @@
|
|||||||
listAllFilesAndDirs(monitor_directory_handler).then(async function (
|
listAllFilesAndDirs(monitor_directory_handler).then(async function (
|
||||||
items) {
|
items) {
|
||||||
files_to_add = new Set();
|
files_to_add = new Set();
|
||||||
|
current_files = getCurrentFiles();
|
||||||
|
current_files_tuple = new Set()
|
||||||
|
for (let elem of current_files) {
|
||||||
|
current_files_tuple.add([elem.size, elem.name,
|
||||||
|
elem.lastModified
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < items.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
|
|
||||||
files_to_add.add(await items[i].handle
|
f = await items[i].handle.getFile()
|
||||||
.getFile());
|
if (!current_files_tuple.has([f.size, f.name, f
|
||||||
|
.lastModified
|
||||||
|
])) {
|
||||||
|
files_to_add.add(f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
current_files = getCurrentFiles();
|
|
||||||
let distinct_set = new Set([...files_to_add].filter(
|
|
||||||
x => !current_files.has(x)));
|
|
||||||
|
|
||||||
console.log(files_to_add, current_files, distinct_set);
|
// file objects differ enough that the following does not work
|
||||||
|
//let distinct_set = new Set([...files_to_add].filter(
|
||||||
|
// x => !current_files.has(x)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
console.log(files_to_add, current_files,
|
||||||
|
distinct_set);
|
||||||
|
|
||||||
extendInputs(distinct_set.size);
|
extendInputs(distinct_set.size);
|
||||||
distinct_set.forEach((file) => {
|
distinct_set.forEach((file) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user