mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-31 06:41:03 +00:00
Sonar fix
This commit is contained in:
@@ -50,7 +50,7 @@ export class DownloadManager {
|
|||||||
const pathParts = pathname.split('/');
|
const pathParts = pathname.split('/');
|
||||||
const filename = pathParts[pathParts.length - 1];
|
const filename = pathParts[pathParts.length - 1];
|
||||||
|
|
||||||
if (filename && filename.includes('.') && filename.length > 0) {
|
if (filename?.includes('.') && filename.length > 0) {
|
||||||
return decodeURIComponent(filename);
|
return decodeURIComponent(filename);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
@@ -61,7 +61,7 @@ export class DownloadManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static sanitizeFilename(filename: string): string {
|
private static sanitizeFilename(filename: string): string {
|
||||||
return filename.replace(/[<>:"/\\|?*]/g, '_');
|
return filename.replaceAll(/[<>:"/\\|?*]/g, '_');
|
||||||
}
|
}
|
||||||
|
|
||||||
private static createDownloadPayload(directUrl: string, originalUrl: string, downloadId: string, savePath: string) {
|
private static createDownloadPayload(directUrl: string, originalUrl: string, downloadId: string, savePath: string) {
|
||||||
@@ -449,4 +449,4 @@ export class DownloadManager {
|
|||||||
await PythonRPC.rpc.post("/action", payload);
|
await PythonRPC.rpc.post("/action", payload);
|
||||||
this.downloadingGameId = levelKeys.game(download.shop, download.objectId);
|
this.downloadingGameId = levelKeys.game(download.shop, download.objectId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user