|
235 | 235 | const res = await GetRootPath(); |
236 | 236 | const baseDir = './OpenTaiko/Songs'; |
237 | 237 | const baseDirPath = await path.join(res, baseDir); |
238 | | - const localPath = `${baseDir}/${(currentObj !== null) ? currentObj.chartRelativePath : songObj.tjaFolderPath}`; |
| 238 | + const localPath = `${baseDir}/${(currentObj !== null) ? currentObj.chartRelativePath : songObj.tjaFolderPath}`.replace(/\\/g, '/'); |
239 | 239 | const tjaFullPath = await path.join(res, localPath); |
240 | 240 |
|
241 | 241 | let fold_exists = await exists(tjaFullPath); |
|
256 | 256 | for (const filePath of songObj.tjaFilesPath) { |
257 | 257 | const localFileName = filePath.split("\\").pop(); |
258 | 258 | const tjaFileUrl = `https://raw.githubusercontent.com/OpenTaiko/OpenTaiko-Soundtrack/main/${filePath}`; |
259 | | - const dlPath = await path.join(chartDownloadFolder, localFileName); |
| 259 | + const dlPath = await path.join(chartDownloadFolder, localFileName.replace(/\\/g, '/')); |
260 | 260 |
|
261 | 261 | |
262 | 262 | const success = await backoffDownload( |
|
279 | 279 |
|
280 | 280 | songDLProgress[songObj.uniqueId] = 0; |
281 | 281 | await Promise.all(fileNames.map(async (fn, idx) => { |
282 | | - const strPath = await path.join(chartDownloadFolder, fn); |
283 | | - const destPath = await path.join(tjaFullPath, fn); |
| 282 | + const strPath = await path.join(chartDownloadFolder, fn.replace(/\\/g, '/')); |
| 283 | + const destPath = await path.join(tjaFullPath, fn.replace(/\\/g, '/')); |
284 | 284 |
|
285 | 285 | await copyFile(strPath, destPath); |
286 | 286 | songDLProgress[songObj.uniqueId] = (idx + 1) * (100 / fileNames.length); |
|
0 commit comments