bburky / playnite-non-steam-shortcuts

A Playnite extension to create non-Steam shortcuts
MIT License
38 stars 2 forks source link

Set "lastplaytime" to playnites last reported playtime #9

Open Bluscream opened 4 years ago

Bluscream commented 4 years ago
bburky commented 4 years ago

This is possible I think, shortcuts.vdf supports it. But what happens after the initial import? If you play a game from steam, does it update the value inside shortcuts.vdf with the added playtime?

Or are you okay with this becoming very out of sync until the user regenerates the shortcuts? (It's theoretically possible to hook the on_game_stopped Playnite event and detect the changed playtime. But you can't really update shortcuts.vdf in the background I don't think. If the user is currently modifying their shortcuts in the Steam UI, we don't want to clobber changes, and Steam only reloads shortcuts.vdf on launch. This extension doesn't do updates in the background.)

Bluscream commented 4 years ago

How hard are you regenerating the shortcuts.vdf file? If you can read the value for each game in there before overwriting it should be as easy as if (vdf.shortcut[current].lastplaytime == 0) overwriteWithPlayNiteLastPlayTime() so after handing once to steam it takes care of it since it will see all playtime of the internal shortcut anyway ^^