|
1 | 1 | /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ |
2 | | -import { downloadGameData } from './download'; |
3 | | -import { fpDatabase } from '.'; |
| 2 | +import { BackOut } from '@shared/back/types'; |
| 3 | +import { getGameDataFilename } from '@shared/utils/misc'; |
| 4 | +import { AxiosError } from 'axios'; |
| 5 | +import { DownloaderStatus, DownloadTask, DownloadTaskStatus, DownloadWorkerState, Game, GameDataSource } from 'flashpoint-launcher'; |
4 | 6 | import * as fs from 'fs-extra'; |
5 | 7 | import * as path from 'node:path'; |
6 | | -import { DownloaderStatus, DownloadTask, DownloadTaskStatus, DownloadWorkerState, Game, GameDataSource } from 'flashpoint-launcher'; |
| 8 | +import { fpDatabase } from '.'; |
7 | 9 | import { axios } from './dns'; |
| 10 | +import { downloadGameData } from './download'; |
8 | 11 | import { BackState } from './types'; |
9 | | -import { BackOut } from '@shared/back/types'; |
| 12 | +import { EventQueue } from './util/EventQueue'; |
10 | 13 | import { promiseSleep } from './util/misc'; |
11 | 14 | import { WrappedEventEmitter } from './util/WrappedEventEmitter'; |
12 | | -import { EventQueue } from './util/EventQueue'; |
13 | | -import { AxiosError } from 'axios'; |
14 | | -import { getGameDataFilename } from '@shared/utils/misc'; |
15 | 15 |
|
16 | 16 | export interface Downloader { |
17 | 17 | on (event: string, listener: (...args: any[]) => void): this; |
@@ -319,8 +319,7 @@ class DownloadWorker { |
319 | 319 | // Calc the path on disk and check if the file already matches |
320 | 320 | const realPath = path.join(this.downloader.flashpointPath, this.downloader.dataPacksFolderPath, getGameDataFilename(gameData)); |
321 | 321 | if (fs.existsSync(realPath)) { |
322 | | - if (gameData.path !== realPath || gameData.presentOnDisk === false) { |
323 | | - gameData.path = realPath; |
| 322 | + if (gameData.presentOnDisk === false) { |
324 | 323 | gameData.presentOnDisk = true; |
325 | 324 | await new Promise<void>((resolve, reject) => { |
326 | 325 | this.downloader.databaseQueue.push(async () => { |
|
0 commit comments