Improved chart pack destination folder name

This commit is contained in:
Geomitron
2020-05-18 00:07:10 -04:00
parent 9cdc5e8847
commit 502360bec4
2 changed files with 7 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import { FileDownloader } from './FileDownloader' import { FileDownloader } from './FileDownloader'
import { join } from 'path' import { join, parse } from 'path'
import { FileExtractor } from './FileExtractor' import { FileExtractor } from './FileExtractor'
import { sanitizeFilename, interpolate } from '../../shared/UtilFunctions' import { sanitizeFilename, interpolate } from '../../shared/UtilFunctions'
import { emitIPCEvent } from '../../main' import { emitIPCEvent } from '../../main'
@@ -46,8 +46,12 @@ export class ChartDownload {
this.updateGUI('', 'Waiting for other downloads to finish...', 'good') this.updateGUI('', 'Waiting for other downloads to finish...', 'good')
this.files = data.driveData.files this.files = data.driveData.files
this.individualFileProgressPortion = 80 / this.files.length this.individualFileProgressPortion = 80 / this.files.length
if (data.driveData.inChartPack) {
this.destinationFolderName = sanitizeFilename(parse(data.driveData.files[0].name).name)
} else {
this.destinationFolderName = sanitizeFilename(`${this.data.artist} - ${this.data.avTagName} (${this.data.charter})`) this.destinationFolderName = sanitizeFilename(`${this.data.artist} - ${this.data.avTagName} (${this.data.charter})`)
} }
}
/** /**
* Calls `callback` when `event` fires. (no events will be fired after `this.cancel()` is called) * Calls `callback` when `event` fires. (no events will be fired after `this.cancel()` is called)

View File

@@ -16,7 +16,7 @@ export interface NewDownload {
avTagName: string avTagName: string
artist: string artist: string
charter: string charter: string
driveData: DriveChart driveData: DriveChart & { inChartPack: boolean }
} }
/** /**