mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-24 05:54:55 +03:00
Merge branch 'rc/v2.0' into feature/refator-process-watcher-and-game-running
This commit is contained in:
commit
e092d701b4
@ -32,10 +32,12 @@ export const mergeWithRemoteGames = async () => {
|
|||||||
{
|
{
|
||||||
objectID: game.objectId,
|
objectID: game.objectId,
|
||||||
shop: "steam",
|
shop: "steam",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
remoteId: game.id,
|
||||||
lastTimePlayed: updatedLastTimePlayed,
|
lastTimePlayed: updatedLastTimePlayed,
|
||||||
playTimeInMilliseconds: updatedPlayTime,
|
playTimeInMilliseconds: updatedPlayTime,
|
||||||
},
|
}
|
||||||
{ remoteId: game.id }
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const steamGame = await steamGamesWorker.run(Number(game.objectId), {
|
const steamGame = await steamGamesWorker.run(Number(game.objectId), {
|
||||||
|
@ -3,11 +3,11 @@ import { HydraApi } from "../hydra-api";
|
|||||||
|
|
||||||
export const updateGamePlaytime = async (
|
export const updateGamePlaytime = async (
|
||||||
game: Game,
|
game: Game,
|
||||||
delta: number,
|
deltaInMillis: number,
|
||||||
lastTimePlayed: Date
|
lastTimePlayed: Date
|
||||||
) => {
|
) => {
|
||||||
return HydraApi.put(`/games/${game.remoteId}`, {
|
return HydraApi.put(`/games/${game.remoteId}`, {
|
||||||
playTimeDeltaInSeconds: Math.trunc(delta),
|
playTimeDeltaInSeconds: Math.trunc(deltaInMillis / 1000),
|
||||||
lastTimePlayed,
|
lastTimePlayed,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -11,6 +11,7 @@ export const steamGamesWorker = new Piscina({
|
|||||||
workerData: {
|
workerData: {
|
||||||
steamGamesPath: path.join(seedsPath, "steam-games.json"),
|
steamGamesPath: path.join(seedsPath, "steam-games.json"),
|
||||||
},
|
},
|
||||||
|
maxThreads: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const downloadSourceWorker = new Piscina({
|
export const downloadSourceWorker = new Piscina({
|
||||||
|
Loading…
Reference in New Issue
Block a user