mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-27 04:41:03 +00:00
feat: updating real-debrid translations
This commit is contained in:
@@ -29,7 +29,7 @@ const resumeGameDownload = async (
|
||||
.getRepository(Game)
|
||||
.update({ status: "active", progress: Not(1) }, { status: "paused" });
|
||||
|
||||
await DownloadManager.resumeDownload(gameId);
|
||||
await DownloadManager.resumeDownload(game);
|
||||
|
||||
await transactionalEntityManager
|
||||
.getRepository(Game)
|
||||
|
||||
@@ -19,6 +19,7 @@ const startGameDownload = async (
|
||||
where: {
|
||||
objectID,
|
||||
},
|
||||
relations: { repack: true },
|
||||
}),
|
||||
repackRepository.findOne({
|
||||
where: {
|
||||
@@ -50,9 +51,7 @@ const startGameDownload = async (
|
||||
}
|
||||
);
|
||||
|
||||
await DownloadManager.startDownload(game.id);
|
||||
|
||||
return { ...game, stauts: "active" };
|
||||
return DownloadManager.startDownload(game);
|
||||
} else {
|
||||
const steamGame = stateManager
|
||||
.getValue("steamGames")
|
||||
@@ -62,8 +61,8 @@ const startGameDownload = async (
|
||||
? getSteamAppAsset("icon", objectID, steamGame.clientIcon)
|
||||
: null;
|
||||
|
||||
const createdGame = await gameRepository
|
||||
.save({
|
||||
await gameRepository
|
||||
.insert({
|
||||
title,
|
||||
iconUrl,
|
||||
objectID,
|
||||
@@ -83,9 +82,14 @@ const startGameDownload = async (
|
||||
return result;
|
||||
});
|
||||
|
||||
await DownloadManager.startDownload(createdGame.id);
|
||||
const createdGame = await gameRepository.findOne({
|
||||
where: {
|
||||
objectID,
|
||||
},
|
||||
relations: { repack: true },
|
||||
});
|
||||
|
||||
return createdGame;
|
||||
return DownloadManager.startDownload(createdGame!);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2,23 +2,17 @@ import { userPreferencesRepository } from "@main/repository";
|
||||
import { registerEvent } from "../register-event";
|
||||
|
||||
import type { UserPreferences } from "@types";
|
||||
import { RealDebridClient } from "@main/services/real-debrid";
|
||||
|
||||
const updateUserPreferences = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
preferences: Partial<UserPreferences>
|
||||
) => {
|
||||
if (preferences.realDebridApiToken) {
|
||||
RealDebridClient.authorize(preferences.realDebridApiToken);
|
||||
}
|
||||
|
||||
await userPreferencesRepository.upsert(
|
||||
) =>
|
||||
userPreferencesRepository.upsert(
|
||||
{
|
||||
id: 1,
|
||||
...preferences,
|
||||
},
|
||||
["id"]
|
||||
);
|
||||
};
|
||||
|
||||
registerEvent("updateUserPreferences", updateUserPreferences);
|
||||
|
||||
Reference in New Issue
Block a user