Try steam sync using 'BytesDownloaded' to detect install state

This commit is contained in:
Xodetaetl 2014-10-21 10:54:39 +02:00
parent 781514c8f3
commit 32572953bd
2 changed files with 10 additions and 2 deletions

1
debian/changelog vendored
View file

@ -16,6 +16,7 @@ lutris (0.3.6) trusty; urgency=medium
- sdlmame and sdlmess runners renamed to mame and mess
- "Prefix command" system option
- Button to access runners folder in the Manage runners window
- Manually re-synchronize from the menu: Lutris > Synchronize library
* Fixes:
- Fixed inconsistent password field limit to 26 chars, raised to 1024.

View file

@ -8,7 +8,7 @@ from lutris.runners.steam import steam
from lutris.runners.winesteam import winesteam
from lutris.util import resources
from lutris.util.log import logger
from lutris.util.steam import get_path_from_appmanifest
from lutris.util.steam import vdf_parse
class Sync(object):
@ -189,6 +189,13 @@ class Sync(object):
logger.error("Invalid SteamID for %s", filename)
continue
if get_path_from_appmanifest(dirname, steamid):
appmanifest_path = os.path.join(
dirname, "appmanifest_%s.acf" % str(steamid)
)
with open(appmanifest_path, "r") as appmanifest_file:
appmanifest = vdf_parse(appmanifest_file, {})
appstate = appmanifest.get('AppState') or {}
is_installed = appstate.get('BytesDownloaded') or '0'
if not is_installed == '0':
installed.append(steamid)
return installed