From 502360bec496182a1d9307df810f1258c93195e2 Mon Sep 17 00:00:00 2001 From: Geomitron <22552797+Geomitron@users.noreply.github.com> Date: Mon, 18 May 2020 00:07:10 -0400 Subject: [PATCH] Improved chart pack destination folder name --- src/electron/ipc/download/ChartDownload.ts | 8 ++++++-- src/electron/shared/interfaces/download.interface.ts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/electron/ipc/download/ChartDownload.ts b/src/electron/ipc/download/ChartDownload.ts index 20d4aae..7670ed0 100644 --- a/src/electron/ipc/download/ChartDownload.ts +++ b/src/electron/ipc/download/ChartDownload.ts @@ -1,5 +1,5 @@ import { FileDownloader } from './FileDownloader' -import { join } from 'path' +import { join, parse } from 'path' import { FileExtractor } from './FileExtractor' import { sanitizeFilename, interpolate } from '../../shared/UtilFunctions' import { emitIPCEvent } from '../../main' @@ -46,7 +46,11 @@ export class ChartDownload { this.updateGUI('', 'Waiting for other downloads to finish...', 'good') this.files = data.driveData.files this.individualFileProgressPortion = 80 / this.files.length - this.destinationFolderName = sanitizeFilename(`${this.data.artist} - ${this.data.avTagName} (${this.data.charter})`) + 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})`) + } } /** diff --git a/src/electron/shared/interfaces/download.interface.ts b/src/electron/shared/interfaces/download.interface.ts index b1a7bbe..3b4a913 100644 --- a/src/electron/shared/interfaces/download.interface.ts +++ b/src/electron/shared/interfaces/download.interface.ts @@ -16,7 +16,7 @@ export interface NewDownload { avTagName: string artist: string charter: string - driveData: DriveChart + driveData: DriveChart & { inChartPack: boolean } } /**