diff --git a/src/main/services/download/download-manager.ts b/src/main/services/download/download-manager.ts index 8573e116..dac9d6ff 100644 --- a/src/main/services/download/download-manager.ts +++ b/src/main/services/download/download-manager.ts @@ -450,9 +450,9 @@ export class DownloadManager { } | null> { switch (download.downloader) { case Downloader.Gofile: { - const id = download.uri.split("/").pop()!; + const id = download.uri.split("/").pop(); const token = await GofileApi.authorize(); - const downloadLink = await GofileApi.getDownloadLink(id); + const downloadLink = await GofileApi.getDownloadLink(id as string); await GofileApi.checkDownloadUrl(downloadLink); return { @@ -462,8 +462,8 @@ export class DownloadManager { }; } case Downloader.PixelDrain: { - const id = download.uri.split("/").pop()!; - const downloadUrl = await PixelDrainApi.getDownloadUrl(id); + const id = download.uri.split("/").pop(); + const downloadUrl = await PixelDrainApi.getDownloadUrl(id as string); return { url: downloadUrl, @@ -576,9 +576,9 @@ export class DownloadManager { switch (download.downloader) { case Downloader.Gofile: { - const id = download.uri.split("/").pop()!; + const id = download.uri.split("/").pop(); const token = await GofileApi.authorize(); - const downloadLink = await GofileApi.getDownloadLink(id); + const downloadLink = await GofileApi.getDownloadLink(id as string); await GofileApi.checkDownloadUrl(downloadLink); return { @@ -592,8 +592,8 @@ export class DownloadManager { }; } case Downloader.PixelDrain: { - const id = download.uri.split("/").pop()!; - const downloadUrl = await PixelDrainApi.getDownloadUrl(id); + const id = download.uri.split("/").pop(); + const downloadUrl = await PixelDrainApi.getDownloadUrl(id as string); return { action: "start", diff --git a/src/main/services/download/js-http-downloader.ts b/src/main/services/download/js-http-downloader.ts index f4769e6a..5f0af779 100644 --- a/src/main/services/download/js-http-downloader.ts +++ b/src/main/services/download/js-http-downloader.ts @@ -134,7 +134,7 @@ export class JsHttpDownloader { ): Promise { const response = await fetch(url, { headers: requestHeaders, - signal: this.abortController!.signal, + signal: this.abortController?.signal, }); if (!response.ok && response.status !== 206) { diff --git a/src/main/services/download/js-multi-link-downloader.ts b/src/main/services/download/js-multi-link-downloader.ts index 05d80fd6..0d105b6d 100644 --- a/src/main/services/download/js-multi-link-downloader.ts +++ b/src/main/services/download/js-multi-link-downloader.ts @@ -61,7 +61,7 @@ export class JsMultiLinkDownloader { }); const status = this.downloader.getDownloadStatus(); - if (status && status.status === "complete") { + if (status?.status === "complete") { this.completedDownloads.push({ name: status.folderName, size: status.fileSize, @@ -105,7 +105,7 @@ export class JsMultiLinkDownloader { }); const status = this.downloader.getDownloadStatus(); - if (status && status.status === "complete") { + if (status?.status === "complete") { this.completedDownloads.push({ name: status.folderName, size: status.fileSize,