mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-09 05:09:39 +00:00
Make filesystem operations more robust
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
"start": "concurrently \"npm run start:angular\" \"npm run start:electron\" -n angular,electron -c red,yellow",
|
||||
"start:angular": "ng serve",
|
||||
"start:electron": "nodemon --exec \"tsc -p src-electron/tsconfig.electron.json && node src-electron/rename-to-mjs.js && electron ./dist/electron/src-electron/main.js --dev\" --watch src-electron/ -e ts",
|
||||
"clean": "rimraf dist release",
|
||||
"build:windows": "ng build -c production && tsc -p src-electron/tsconfig.electron.json && electron-builder build --windows",
|
||||
"build:mac": "ng build -c production && tsc -p src-electron/tsconfig.electron.json && electron-builder build --mac",
|
||||
"build:linux": "ng build -c production && tsc -p src-electron/tsconfig.electron.json && electron-builder build --linux",
|
||||
@@ -40,16 +39,13 @@
|
||||
"electron-unhandled": "^5.0.0",
|
||||
"electron-updater": "^6.2.1",
|
||||
"electron-window-state": "^5.0.3",
|
||||
"fs-extra": "^11.2.0",
|
||||
"lodash": "^4.17.21",
|
||||
"mkdirp": "^3.0.1",
|
||||
"mv": "^2.1.1",
|
||||
"parse-sng": "^4.0.1",
|
||||
"rimraf": "^6.0.0",
|
||||
"rxjs": "~7.8.1",
|
||||
"sanitize-filename": "^1.6.3",
|
||||
"scan-chart": "^3.4.1",
|
||||
"tslib": "^2.6.3",
|
||||
"undici": "^6.3.0",
|
||||
"zod": "^3.23.8",
|
||||
"zone.js": "~0.14.2"
|
||||
},
|
||||
@@ -63,8 +59,8 @@
|
||||
"@angular/cli": "^18.0.7",
|
||||
"@angular/compiler-cli": "^18.0.6",
|
||||
"@angular/language-service": "^18.0.6",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/lodash": "^4.17.6",
|
||||
"@types/mv": "^2.1.0",
|
||||
"@types/node": "^18.16.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
||||
"@typescript-eslint/parser": "^7.16.0",
|
||||
|
||||
174
pnpm-lock.yaml
generated
174
pnpm-lock.yaml
generated
@@ -50,21 +50,15 @@ importers:
|
||||
electron-window-state:
|
||||
specifier: ^5.0.3
|
||||
version: 5.0.3
|
||||
fs-extra:
|
||||
specifier: ^11.2.0
|
||||
version: 11.2.0
|
||||
lodash:
|
||||
specifier: ^4.17.21
|
||||
version: 4.17.21
|
||||
mkdirp:
|
||||
specifier: ^3.0.1
|
||||
version: 3.0.1
|
||||
mv:
|
||||
specifier: ^2.1.1
|
||||
version: 2.1.1
|
||||
parse-sng:
|
||||
specifier: ^4.0.1
|
||||
version: 4.0.1
|
||||
rimraf:
|
||||
specifier: ^6.0.0
|
||||
version: 6.0.0
|
||||
rxjs:
|
||||
specifier: ~7.8.1
|
||||
version: 7.8.1
|
||||
@@ -77,9 +71,6 @@ importers:
|
||||
tslib:
|
||||
specifier: ^2.6.3
|
||||
version: 2.6.3
|
||||
undici:
|
||||
specifier: ^6.3.0
|
||||
version: 6.3.0
|
||||
zod:
|
||||
specifier: ^3.23.8
|
||||
version: 3.23.8
|
||||
@@ -114,12 +105,12 @@ importers:
|
||||
'@angular/language-service':
|
||||
specifier: ^18.0.6
|
||||
version: 18.0.6
|
||||
'@types/fs-extra':
|
||||
specifier: ^11.0.4
|
||||
version: 11.0.4
|
||||
'@types/lodash':
|
||||
specifier: ^4.17.6
|
||||
version: 4.17.6
|
||||
'@types/mv':
|
||||
specifier: ^2.1.0
|
||||
version: 2.1.4
|
||||
'@types/node':
|
||||
specifier: ^18.16.0
|
||||
version: 18.16.0
|
||||
@@ -801,10 +792,6 @@ packages:
|
||||
resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
||||
'@fastify/busboy@2.1.0':
|
||||
resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==}
|
||||
engines: {node: '>=14'}
|
||||
|
||||
'@humanwhocodes/config-array@0.11.14':
|
||||
resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==}
|
||||
engines: {node: '>=10.10.0'}
|
||||
@@ -1195,6 +1182,9 @@ packages:
|
||||
'@types/estree@1.0.5':
|
||||
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
|
||||
|
||||
'@types/fs-extra@11.0.4':
|
||||
resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==}
|
||||
|
||||
'@types/fs-extra@9.0.13':
|
||||
resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==}
|
||||
|
||||
@@ -1207,6 +1197,9 @@ packages:
|
||||
'@types/json5@0.0.29':
|
||||
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
|
||||
|
||||
'@types/jsonfile@6.1.4':
|
||||
resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==}
|
||||
|
||||
'@types/keyv@3.1.4':
|
||||
resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
|
||||
|
||||
@@ -1216,9 +1209,6 @@ packages:
|
||||
'@types/ms@0.7.34':
|
||||
resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==}
|
||||
|
||||
'@types/mv@2.1.4':
|
||||
resolution: {integrity: sha512-MgEHBpXnQo44Q43j8G0Bvp/Yi8LYbC8hxKrRFMgDEDZMmzDKZLgiyMWtW49B37ko+QupgZ3G5rtPUnOGe5ixLw==}
|
||||
|
||||
'@types/node@18.16.0':
|
||||
resolution: {integrity: sha512-BsAaKhB+7X+H4GnSjGhJG9Qi8Tw+inU9nJDwmD5CgOmBLEI6ArdhikpLX7DjbjDRDTbqZzU2LSQNZg8WGPiSZQ==}
|
||||
|
||||
@@ -2339,8 +2329,8 @@ packages:
|
||||
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
fs-extra@11.1.1:
|
||||
resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==}
|
||||
fs-extra@11.2.0:
|
||||
resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==}
|
||||
engines: {node: '>=14.14'}
|
||||
|
||||
fs-extra@8.1.0:
|
||||
@@ -2416,15 +2406,6 @@ packages:
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
hasBin: true
|
||||
|
||||
glob@11.0.0:
|
||||
resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==}
|
||||
engines: {node: 20 || >=22}
|
||||
hasBin: true
|
||||
|
||||
glob@6.0.4:
|
||||
resolution: {integrity: sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==}
|
||||
deprecated: Glob versions prior to v9 are no longer supported
|
||||
|
||||
glob@7.1.6:
|
||||
resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==}
|
||||
deprecated: Glob versions prior to v9 are no longer supported
|
||||
@@ -2732,10 +2713,6 @@ packages:
|
||||
resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==}
|
||||
engines: {node: '>=14'}
|
||||
|
||||
jackspeak@4.0.1:
|
||||
resolution: {integrity: sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
jake@10.8.7:
|
||||
resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -2903,10 +2880,6 @@ packages:
|
||||
resolution: {integrity: sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==}
|
||||
engines: {node: 14 || >=16.14}
|
||||
|
||||
lru-cache@11.0.0:
|
||||
resolution: {integrity: sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
lru-cache@5.1.1:
|
||||
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
|
||||
|
||||
@@ -2970,10 +2943,6 @@ packages:
|
||||
resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
minimatch@10.0.1:
|
||||
resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
minimatch@3.1.2:
|
||||
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
|
||||
|
||||
@@ -3024,10 +2993,6 @@ packages:
|
||||
resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==}
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
|
||||
minipass@7.1.2:
|
||||
resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
|
||||
minizlib@2.1.2:
|
||||
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
|
||||
engines: {node: '>= 8'}
|
||||
@@ -3044,11 +3009,6 @@ packages:
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
|
||||
mkdirp@3.0.1:
|
||||
resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==}
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
|
||||
mrmime@2.0.0:
|
||||
resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -3070,10 +3030,6 @@ packages:
|
||||
resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==}
|
||||
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
|
||||
|
||||
mv@2.1.1:
|
||||
resolution: {integrity: sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==}
|
||||
engines: {node: '>=0.8.0'}
|
||||
|
||||
mz@2.7.0:
|
||||
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
|
||||
|
||||
@@ -3088,10 +3044,6 @@ packages:
|
||||
natural-compare@1.4.0:
|
||||
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
|
||||
|
||||
ncp@2.0.0:
|
||||
resolution: {integrity: sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==}
|
||||
hasBin: true
|
||||
|
||||
negotiator@0.6.3:
|
||||
resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==}
|
||||
engines: {node: '>= 0.6'}
|
||||
@@ -3285,9 +3237,6 @@ packages:
|
||||
resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
package-json-from-dist@1.0.0:
|
||||
resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==}
|
||||
|
||||
pacote@18.0.6:
|
||||
resolution: {integrity: sha512-+eK3G27SMwsB8kLIuj4h1FUhHtwiEUo21Tw8wNjmvdlpOEr613edv+8FUsTj/4F/VN5ywGE19X18N7CC2EJk6A==}
|
||||
engines: {node: ^16.14.0 || >=18.0.0}
|
||||
@@ -3335,10 +3284,6 @@ packages:
|
||||
resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==}
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
|
||||
path-scurry@2.0.0:
|
||||
resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
path-type@4.0.0:
|
||||
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -3575,21 +3520,11 @@ packages:
|
||||
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
|
||||
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
|
||||
|
||||
rimraf@2.4.5:
|
||||
resolution: {integrity: sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==}
|
||||
deprecated: Rimraf versions prior to v4 are no longer supported
|
||||
hasBin: true
|
||||
|
||||
rimraf@3.0.2:
|
||||
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
|
||||
deprecated: Rimraf versions prior to v4 are no longer supported
|
||||
hasBin: true
|
||||
|
||||
rimraf@6.0.0:
|
||||
resolution: {integrity: sha512-u+yqhM92LW+89cxUQK0SRyvXYQmyuKHx0jkx4W7KfwLGLqJnQM5031Uv1trE4gB9XEXBM/s6MxKlfW95IidqaA==}
|
||||
engines: {node: 20 || >=22}
|
||||
hasBin: true
|
||||
|
||||
roarr@2.15.4:
|
||||
resolution: {integrity: sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==}
|
||||
engines: {node: '>=8.0'}
|
||||
@@ -4052,10 +3987,6 @@ packages:
|
||||
resolution: {integrity: sha512-nT8jjv/fE9Et1ilR6QoW8ingRTY2Pp4l2RUrdzV5Yz35RJDrtPc1DXvuNqcpsJSGIRHFdt3YKKktTzJA6r0fTA==}
|
||||
engines: {node: '>=18.17'}
|
||||
|
||||
undici@6.3.0:
|
||||
resolution: {integrity: sha512-zkSMOXs2topAR1LF0PxAaNNvhdX4LYEcmRMJLMh3mjgfZpBtc/souXOp4aYiR5Q46HrBPA2/8DkEZhD3eNFE1Q==}
|
||||
engines: {node: '>=18.0'}
|
||||
|
||||
unique-filename@3.0.0:
|
||||
resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==}
|
||||
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
|
||||
@@ -4877,8 +4808,6 @@ snapshots:
|
||||
|
||||
'@eslint/js@8.57.0': {}
|
||||
|
||||
'@fastify/busboy@2.1.0': {}
|
||||
|
||||
'@humanwhocodes/config-array@0.11.14':
|
||||
dependencies:
|
||||
'@humanwhocodes/object-schema': 2.0.3
|
||||
@@ -5243,6 +5172,11 @@ snapshots:
|
||||
|
||||
'@types/estree@1.0.5': {}
|
||||
|
||||
'@types/fs-extra@11.0.4':
|
||||
dependencies:
|
||||
'@types/jsonfile': 6.1.4
|
||||
'@types/node': 18.16.0
|
||||
|
||||
'@types/fs-extra@9.0.13':
|
||||
dependencies:
|
||||
'@types/node': 18.16.0
|
||||
@@ -5253,6 +5187,10 @@ snapshots:
|
||||
|
||||
'@types/json5@0.0.29': {}
|
||||
|
||||
'@types/jsonfile@6.1.4':
|
||||
dependencies:
|
||||
'@types/node': 18.16.0
|
||||
|
||||
'@types/keyv@3.1.4':
|
||||
dependencies:
|
||||
'@types/node': 18.16.0
|
||||
@@ -5261,8 +5199,6 @@ snapshots:
|
||||
|
||||
'@types/ms@0.7.34': {}
|
||||
|
||||
'@types/mv@2.1.4': {}
|
||||
|
||||
'@types/node@18.16.0': {}
|
||||
|
||||
'@types/node@20.14.10':
|
||||
@@ -6668,7 +6604,7 @@ snapshots:
|
||||
jsonfile: 6.1.0
|
||||
universalify: 2.0.1
|
||||
|
||||
fs-extra@11.1.1:
|
||||
fs-extra@11.2.0:
|
||||
dependencies:
|
||||
graceful-fs: 4.2.11
|
||||
jsonfile: 6.1.0
|
||||
@@ -6752,23 +6688,6 @@ snapshots:
|
||||
minipass: 7.0.4
|
||||
path-scurry: 1.10.1
|
||||
|
||||
glob@11.0.0:
|
||||
dependencies:
|
||||
foreground-child: 3.1.1
|
||||
jackspeak: 4.0.1
|
||||
minimatch: 10.0.1
|
||||
minipass: 7.1.2
|
||||
package-json-from-dist: 1.0.0
|
||||
path-scurry: 2.0.0
|
||||
|
||||
glob@6.0.4:
|
||||
dependencies:
|
||||
inflight: 1.0.6
|
||||
inherits: 2.0.4
|
||||
minimatch: 3.1.2
|
||||
once: 1.4.0
|
||||
path-is-absolute: 1.0.1
|
||||
|
||||
glob@7.1.6:
|
||||
dependencies:
|
||||
fs.realpath: 1.0.0
|
||||
@@ -7097,12 +7016,6 @@ snapshots:
|
||||
optionalDependencies:
|
||||
'@pkgjs/parseargs': 0.11.0
|
||||
|
||||
jackspeak@4.0.1:
|
||||
dependencies:
|
||||
'@isaacs/cliui': 8.0.2
|
||||
optionalDependencies:
|
||||
'@pkgjs/parseargs': 0.11.0
|
||||
|
||||
jake@10.8.7:
|
||||
dependencies:
|
||||
async: 3.2.5
|
||||
@@ -7249,8 +7162,6 @@ snapshots:
|
||||
|
||||
lru-cache@10.1.0: {}
|
||||
|
||||
lru-cache@11.0.0: {}
|
||||
|
||||
lru-cache@5.1.1:
|
||||
dependencies:
|
||||
yallist: 3.1.1
|
||||
@@ -7329,10 +7240,6 @@ snapshots:
|
||||
|
||||
mimic-response@3.1.0: {}
|
||||
|
||||
minimatch@10.0.1:
|
||||
dependencies:
|
||||
brace-expansion: 2.0.1
|
||||
|
||||
minimatch@3.1.2:
|
||||
dependencies:
|
||||
brace-expansion: 1.1.11
|
||||
@@ -7383,8 +7290,6 @@ snapshots:
|
||||
|
||||
minipass@7.0.4: {}
|
||||
|
||||
minipass@7.1.2: {}
|
||||
|
||||
minizlib@2.1.2:
|
||||
dependencies:
|
||||
minipass: 3.3.6
|
||||
@@ -7398,8 +7303,6 @@ snapshots:
|
||||
|
||||
mkdirp@1.0.4: {}
|
||||
|
||||
mkdirp@3.0.1: {}
|
||||
|
||||
mrmime@2.0.0: {}
|
||||
|
||||
ms@2.1.2: {}
|
||||
@@ -7424,12 +7327,6 @@ snapshots:
|
||||
|
||||
mute-stream@1.0.0: {}
|
||||
|
||||
mv@2.1.1:
|
||||
dependencies:
|
||||
mkdirp: 0.5.6
|
||||
ncp: 2.0.0
|
||||
rimraf: 2.4.5
|
||||
|
||||
mz@2.7.0:
|
||||
dependencies:
|
||||
any-promise: 1.3.0
|
||||
@@ -7442,8 +7339,6 @@ snapshots:
|
||||
|
||||
natural-compare@1.4.0: {}
|
||||
|
||||
ncp@2.0.0: {}
|
||||
|
||||
negotiator@0.6.3: {}
|
||||
|
||||
nice-napi@1.0.2:
|
||||
@@ -7593,7 +7488,7 @@ snapshots:
|
||||
figures: 3.2.0
|
||||
flat: 5.0.2
|
||||
front-matter: 4.0.2
|
||||
fs-extra: 11.1.1
|
||||
fs-extra: 11.2.0
|
||||
ignore: 5.3.0
|
||||
jest-diff: 29.7.0
|
||||
jsonc-parser: 3.2.0
|
||||
@@ -7724,8 +7619,6 @@ snapshots:
|
||||
dependencies:
|
||||
aggregate-error: 3.1.0
|
||||
|
||||
package-json-from-dist@1.0.0: {}
|
||||
|
||||
pacote@18.0.6:
|
||||
dependencies:
|
||||
'@npmcli/git': 5.0.3
|
||||
@@ -7795,11 +7688,6 @@ snapshots:
|
||||
lru-cache: 10.1.0
|
||||
minipass: 7.0.4
|
||||
|
||||
path-scurry@2.0.0:
|
||||
dependencies:
|
||||
lru-cache: 11.0.0
|
||||
minipass: 7.1.2
|
||||
|
||||
path-type@4.0.0: {}
|
||||
|
||||
pend@1.2.0: {}
|
||||
@@ -8026,18 +7914,10 @@ snapshots:
|
||||
|
||||
reusify@1.0.4: {}
|
||||
|
||||
rimraf@2.4.5:
|
||||
dependencies:
|
||||
glob: 6.0.4
|
||||
|
||||
rimraf@3.0.2:
|
||||
dependencies:
|
||||
glob: 7.2.3
|
||||
|
||||
rimraf@6.0.0:
|
||||
dependencies:
|
||||
glob: 11.0.0
|
||||
|
||||
roarr@2.15.4:
|
||||
dependencies:
|
||||
boolean: 3.2.0
|
||||
@@ -8608,10 +8488,6 @@ snapshots:
|
||||
|
||||
undici@6.18.0: {}
|
||||
|
||||
undici@6.3.0:
|
||||
dependencies:
|
||||
'@fastify/busboy': 2.1.0
|
||||
|
||||
unique-filename@3.0.0:
|
||||
dependencies:
|
||||
unique-slug: 4.0.0
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { readFileSync } from 'fs'
|
||||
import { writeFile } from 'fs/promises'
|
||||
import { ensureDir, outputFile } from 'fs-extra'
|
||||
import _ from 'lodash'
|
||||
import { mkdirp } from 'mkdirp'
|
||||
import { inspect } from 'util'
|
||||
|
||||
import { dataPath, settingsPath, tempPath, themesPath } from '../../src-shared/Paths.js'
|
||||
@@ -43,12 +42,13 @@ export async function getSettings() {
|
||||
*/
|
||||
async function saveSettings(settings: Settings) {
|
||||
try {
|
||||
// Create data directories if they don't exist
|
||||
for (const path of [dataPath, tempPath, themesPath]) {
|
||||
await mkdirp(path)
|
||||
}
|
||||
|
||||
await writeFile(settingsPath, JSON.stringify(settings, undefined, 2), 'utf8')
|
||||
await Promise.all([
|
||||
// Create data directories if they don't exist
|
||||
ensureDir(dataPath),
|
||||
ensureDir(tempPath),
|
||||
ensureDir(themesPath),
|
||||
outputFile(settingsPath, JSON.stringify(settings, undefined, 2), { encoding: 'utf8' }),
|
||||
])
|
||||
} catch (err) {
|
||||
console.error('Failed to save settings.\n' + inspect(err))
|
||||
}
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
import { randomUUID } from 'crypto'
|
||||
import EventEmitter from 'events'
|
||||
import { createWriteStream } from 'fs'
|
||||
import { ensureDir, move, remove } from 'fs-extra'
|
||||
import { access, constants } from 'fs/promises'
|
||||
import { IncomingMessage } from 'http'
|
||||
import https from 'https'
|
||||
import _ from 'lodash'
|
||||
import { mkdirp } from 'mkdirp'
|
||||
import mv from 'mv'
|
||||
import { SngStream } from 'parse-sng'
|
||||
import { join } from 'path'
|
||||
import { rimraf } from 'rimraf'
|
||||
import { Readable } from 'stream'
|
||||
import { ReadableStream } from 'stream/web'
|
||||
import { Agent, setGlobalDispatcher } from 'undici'
|
||||
import { inspect } from 'util'
|
||||
|
||||
import { tempPath } from '../../../src-shared/Paths.js'
|
||||
import { sanitizeFilename } from '../../ElectronUtilFunctions.js'
|
||||
import { getSettings } from '../SettingsHandler.ipc.js'
|
||||
|
||||
setGlobalDispatcher(new Agent({ connect: { timeout: 60_000 } }))
|
||||
|
||||
export interface DownloadMessage {
|
||||
header: string
|
||||
body: string
|
||||
@@ -109,7 +104,7 @@ export class ChartDownload {
|
||||
this.showProgress.cancel()
|
||||
this._canceled = true
|
||||
if (this.tempPath) {
|
||||
rimraf(this.tempPath).catch(() => { /** Do nothing */ }) // Delete temp folder
|
||||
remove(this.tempPath).catch(() => { /** Do nothing */ }) // Delete temp folder
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +137,7 @@ export class ChartDownload {
|
||||
this.tempPath = join(tempPath, randomUUID())
|
||||
try {
|
||||
this.showProgress('Creating temporary download folder...')
|
||||
await mkdirp(this.tempPath)
|
||||
await ensureDir(this.tempPath)
|
||||
if (this._canceled) { return }
|
||||
} catch (err) {
|
||||
throw { header: 'Failed to create temporary download folder', body: inspect(err) }
|
||||
@@ -174,7 +169,7 @@ export class ChartDownload {
|
||||
const sngStream = new SngStream(Readable.toWeb(response) as any, { generateSongIni: true })
|
||||
let downloadedByteCount = BigInt(0)
|
||||
|
||||
await mkdirp(join(this.tempPath, this.destinationName))
|
||||
await ensureDir(join(this.tempPath, this.destinationName))
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
sngStream.on('file', async (fileName, fileStream, nextFile) => {
|
||||
@@ -222,10 +217,11 @@ export class ChartDownload {
|
||||
if (this._canceled) { return }
|
||||
|
||||
this.showProgress('Moving chart to library folder...', 100)
|
||||
await new Promise<void>(resolve => setTimeout(resolve, 200)) // Delay for OS file processing
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
if (settings.libraryPath) {
|
||||
const destinationPath = join(settings.libraryPath, this.destinationName)
|
||||
mv(join(this.tempPath, this.destinationName), destinationPath, { mkdirp: true }, err => {
|
||||
move(join(this.tempPath, this.destinationName), destinationPath, { overwrite: true }, err => {
|
||||
if (err) {
|
||||
reject({ header: 'Failed to move chart to library folder', body: inspect(err) })
|
||||
} else {
|
||||
@@ -239,7 +235,7 @@ export class ChartDownload {
|
||||
|
||||
this.showProgress('Deleting temporary folder...')
|
||||
try {
|
||||
await rimraf(this.tempPath)
|
||||
await remove(this.tempPath)
|
||||
} catch (err) {
|
||||
throw { header: 'Failed to delete temporary folder', body: inspect(err) }
|
||||
}
|
||||
@@ -254,12 +250,13 @@ function getDownloadStream(md5: string): Promise<{ response: IncomingMessage; ab
|
||||
const abortController = new AbortController()
|
||||
return new Promise((resolve, reject) => {
|
||||
const request = https.get(`https://files.enchor.us/${md5}.sng`, {
|
||||
agent: new https.Agent({ timeout: 30000 }),
|
||||
headers: {
|
||||
'mode': 'cors',
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'referrer-policy': 'no-referrer',
|
||||
},
|
||||
timeout: 20000,
|
||||
timeout: 30000,
|
||||
signal: abortController.signal,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user