Merge branch 'rc/v2.0' into feature/refator-process-watcher-and-game-running

This commit is contained in:
Zamitto 2024-06-20 11:32:15 -03:00
commit e092d701b4
3 changed files with 7 additions and 4 deletions

View File

@ -32,10 +32,12 @@ export const mergeWithRemoteGames = async () => {
{
objectID: game.objectId,
shop: "steam",
},
{
remoteId: game.id,
lastTimePlayed: updatedLastTimePlayed,
playTimeInMilliseconds: updatedPlayTime,
},
{ remoteId: game.id }
}
);
} else {
const steamGame = await steamGamesWorker.run(Number(game.objectId), {

View File

@ -3,11 +3,11 @@ import { HydraApi } from "../hydra-api";
export const updateGamePlaytime = async (
game: Game,
delta: number,
deltaInMillis: number,
lastTimePlayed: Date
) => {
return HydraApi.put(`/games/${game.remoteId}`, {
playTimeDeltaInSeconds: Math.trunc(delta),
playTimeDeltaInSeconds: Math.trunc(deltaInMillis / 1000),
lastTimePlayed,
});
};

View File

@ -11,6 +11,7 @@ export const steamGamesWorker = new Piscina({
workerData: {
steamGamesPath: path.join(seedsPath, "steam-games.json"),
},
maxThreads: 1,
});
export const downloadSourceWorker = new Piscina({