Skip to content

Commit

Permalink
Skip non-existing apps during initalization
Browse files Browse the repository at this point in the history
  • Loading branch information
Domenico Iezzi committed Nov 5, 2017
1 parent ddcd04a commit 3fd6ccb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions playmaker/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ def makeError(message):
'message': message}

def get_details_from_apk(appDetails, downloadPath):
filepath = os.path.join(downloadPath,
appDetails['docId'] + '.apk')
a = APK(filepath)
appDetails['versionCode'] = int(a.version_code)
print('Added %s to cache' % appDetails['docId'])
if appDetails is not None:
filepath = os.path.join(downloadPath,
appDetails['docId'] + '.apk')
a = APK(filepath)
appDetails['versionCode'] = int(a.version_code)
print('Added %s to cache' % appDetails['docId'])
return appDetails

class Play(object):
Expand Down Expand Up @@ -157,7 +158,8 @@ def update_state(self):
for d in detailsList]
for future in concurrent.futures.as_completed(future_to_app):
app = future.result()
self.currentSet.append(app)
if app is not None:
self.currentSet.append(app)
print('Cache correctly initialized')
self.firstRun = False

Expand Down

0 comments on commit 3fd6ccb

Please sign in to comment.