refactor: replace type assertions with non-null assertions for download ID in DownloadManager

This commit is contained in:
Moyasee
2026-01-06 18:11:22 +02:00
parent 81b3ad3612
commit 2b3a8bf6b6

View File

@@ -452,7 +452,7 @@ export class DownloadManager {
case Downloader.Gofile: {
const id = download.uri.split("/").pop();
const token = await GofileApi.authorize();
const downloadLink = await GofileApi.getDownloadLink(id as string);
const downloadLink = await GofileApi.getDownloadLink(id!);
await GofileApi.checkDownloadUrl(downloadLink);
return {
@@ -463,7 +463,7 @@ export class DownloadManager {
}
case Downloader.PixelDrain: {
const id = download.uri.split("/").pop();
const downloadUrl = await PixelDrainApi.getDownloadUrl(id as string);
const downloadUrl = await PixelDrainApi.getDownloadUrl(id!);
return {
url: downloadUrl,
@@ -578,7 +578,7 @@ export class DownloadManager {
case Downloader.Gofile: {
const id = download.uri.split("/").pop();
const token = await GofileApi.authorize();
const downloadLink = await GofileApi.getDownloadLink(id as string);
const downloadLink = await GofileApi.getDownloadLink(id!);
await GofileApi.checkDownloadUrl(downloadLink);
return {
@@ -593,7 +593,7 @@ export class DownloadManager {
}
case Downloader.PixelDrain: {
const id = download.uri.split("/").pop();
const downloadUrl = await PixelDrainApi.getDownloadUrl(id as string);
const downloadUrl = await PixelDrainApi.getDownloadUrl(id!);
return {
action: "start",