add app and apps icons
This commit is contained in:
parent
e0173d410b
commit
7508811374
16 changed files with 554 additions and 7 deletions
|
|
@ -75,6 +75,8 @@ function parseArgs(args) {
|
|||
return out
|
||||
}
|
||||
|
||||
const GRACE_MS = 60000
|
||||
|
||||
function runGame({ game, wine, systemWine, onExit }) {
|
||||
const isProton = wine && wine.type === 'proton'
|
||||
const { env } = buildEnv({ game, wine })
|
||||
|
|
@ -112,9 +114,15 @@ function runGame({ game, wine, systemWine, onExit }) {
|
|||
child.stderr.pipe(ws)
|
||||
child.on('error', reject)
|
||||
child.unref()
|
||||
const startedAt = Date.now()
|
||||
child.on('exit', (code, signal) => {
|
||||
ws.end()
|
||||
require('./library').updateGame(game.id, { lastPlayed: Date.now() })
|
||||
const playedMs = Date.now() - startedAt
|
||||
const counted = playedMs > GRACE_MS ? Math.round((playedMs - GRACE_MS) / 1000) : 0
|
||||
require('./library').updateGame(game.id, {
|
||||
lastPlayed: Date.now(),
|
||||
playSeconds: (game.playSeconds || 0) + counted
|
||||
})
|
||||
if (onExit) onExit(code, signal)
|
||||
})
|
||||
resolve({ pid: child.pid, logFile })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue