fix uploading dups

This commit is contained in:
Georges-Antoine Assi
2024-08-16 20:11:26 -04:00
parent e9c09b46aa
commit 4fb19b3b59
4 changed files with 11 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.22.2
version: 1.22.3
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
@@ -19,24 +19,24 @@ runtimes:
lint:
enabled:
- markdownlint@0.41.0
- eslint@9.8.0
- eslint@9.9.0
- actionlint@1.7.1
- bandit@1.7.9
- black@24.8.0
- checkov@3.2.219
- checkov@3.2.228
- git-diff-check
- isort@5.13.2
- mypy@1.11.1
- osv-scanner@1.8.3
- oxipng@9.1.2
- prettier@3.3.3
- ruff@0.5.7
- ruff@0.6.0
- shellcheck@0.10.0
- shfmt@3.6.0
- svgo@3.3.2
- taplo@0.9.3
- trivy@0.54.1
- trufflehog@3.81.7
- trufflehog@3.81.9
- yamllint@1.35.1
ignore:
- linters: [ALL]

View File

@@ -81,7 +81,7 @@ async def add_roms(
skipped_files = []
for file in files:
if fs_rom_handler.file_exists(roms_path, file.filename):
if bool(os.path.exists(f"{roms_path}/{file.filename}")):
skipped_files.append(file.filename)
continue

View File

@@ -102,6 +102,8 @@ async function uploadRoms() {
platformId: platformId,
})
.then(({ data }) => {
uploadStore.clear();
const { uploaded_files, skipped_files } = data;
if (uploaded_files.length == 0) {
@@ -109,7 +111,7 @@ async function uploadRoms() {
msg: `All files skipped, nothing to upload.`,
icon: "mdi-close-circle",
color: "orange",
timeout: 2000,
timeout: 5000,
});
}
@@ -117,11 +119,9 @@ async function uploadRoms() {
msg: `${uploaded_files.length} files uploaded successfully (and ${skipped_files.length} skipped). Starting scan...`,
icon: "mdi-check-bold",
color: "green",
timeout: 2000,
timeout: 3000,
});
uploadStore.clear();
if (!socket.connected) socket.connect();
setTimeout(() => {
socket.emit("scan", {

View File

@@ -37,7 +37,7 @@ watch(romsList, (newList) => {
:color="rom.finished ? `green` : `white`"
class="mx-2"
/>
{{ rom.filename }}...
{{ rom.filename }}
</v-list-item-title>
<v-progress-linear
v-if="!rom.finished"