WebUI: padding files are not checked by default

This commit is contained in:
Igor Katson 2025-06-09 20:33:03 +01:00
parent 963f8167de
commit acf67b2439
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
2 changed files with 16 additions and 8 deletions

View file

@ -39,7 +39,15 @@ export const FileSelectionModal = (props: {
useEffect(() => {
setSelectedFiles(
new Set(listTorrentResponse?.details.files.map((_, i) => i)),
new Set(
listTorrentResponse?.details.files.flatMap((file, idx) => {
if (file.attributes.padding) {
return [];
} else {
return [idx];
}
})
)
);
setOutputFolder(listTorrentResponse?.output_folder || "");
}, [listTorrentResponse]);
@ -79,7 +87,7 @@ export const FileSelectionModal = (props: {
},
(e) => {
setUploadError({ text: "Error starting torrent", details: e });
},
}
)
.finally(() => setUploading(false));
};