mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 05:24:55 +03:00
fix: wrong folder name
This commit is contained in:
parent
aa0321df8f
commit
9b9545fb8f
@ -34,7 +34,7 @@ class HttpDownloader:
|
||||
download = self.aria2.get_download(self.download.gid)
|
||||
|
||||
response = {
|
||||
'folderName': str(download.dir) + "/" + download.name,
|
||||
'folderName': download.name,
|
||||
'fileSize': download.total_length,
|
||||
'progress': download.completed_length / download.total_length if download.total_length else 0,
|
||||
'downloadSpeed': download.download_speed,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { HydraApi } from "@main/services";
|
||||
import { registerEvent } from "../register-event";
|
||||
import type { GameArtifact, GameShop } from "@types";
|
||||
import { SubscriptionRequiredError } from "@shared";
|
||||
|
||||
const getGameArtifacts = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
@ -13,8 +14,16 @@ const getGameArtifacts = async (
|
||||
});
|
||||
|
||||
return HydraApi.get<GameArtifact[]>(
|
||||
`/profile/games/artifacts?${params.toString()}`
|
||||
);
|
||||
`/profile/games/artifacts?${params.toString()}`,
|
||||
{},
|
||||
{ needsSubscription: true }
|
||||
).catch((err) => {
|
||||
if (err instanceof SubscriptionRequiredError) {
|
||||
return [];
|
||||
}
|
||||
|
||||
throw err;
|
||||
});
|
||||
};
|
||||
|
||||
registerEvent("getGameArtifacts", getGameArtifacts);
|
||||
|
@ -13,7 +13,7 @@ export class UserNotLoggedInError extends Error {
|
||||
export class SubscriptionRequiredError extends Error {
|
||||
constructor() {
|
||||
super("user does not have hydra cloud subscription");
|
||||
this.name = "UserWithoutCloudSubscriptionError";
|
||||
this.name = "SubscriptionRequiredError";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user