Fix #307 - Nonsense value for LastPlayed?

This commit is contained in:
David Vierra 2017-03-23 14:27:36 -10:00
parent 9c2b991289
commit 6234f25226

View File

@ -70,7 +70,12 @@ class WorldListItemWidget(QtGui.QWidget):
def setWorldInfo(self, (name, lastPlayed, versionInfo)):
self.displayNameLabel.setText(name)
if lastPlayed:
try:
lastPlayedText = arrow.Arrow.fromtimestamp(lastPlayed / 1000.0).humanize()
except ValueError:
# Nonsense value for LastPlayed?
lastPlayedText = "Unknown (Timestamp %s)" % (lastPlayed / 1000.0,)
self.lastPlayedLabel.setText(lastPlayedText)
else:
self.lastPlayedLabel.setText("")