mirror of
https://github.com/Syncplay/syncplay
synced 2025-01-10 00:29:38 +00:00
Manually check for updates if automaticUpdateCheck fails
This commit is contained in:
parent
b555beb974
commit
2d9e3186e8
@ -1559,16 +1559,20 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
currentDateTimeValue = QDateTime.currentDateTime()
|
currentDateTimeValue = QDateTime.currentDateTime()
|
||||||
if not self.config['checkForUpdatesAutomatically']:
|
if not self.config['checkForUpdatesAutomatically']:
|
||||||
return
|
return
|
||||||
if self.config['lastCheckedForUpdates']:
|
try:
|
||||||
configLastChecked = datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f")
|
if self.config['lastCheckedForUpdates']:
|
||||||
if self.lastCheckedForUpdates is None or configLastChecked > self.lastCheckedForUpdates.toPython():
|
configLastChecked = datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f")
|
||||||
self.lastCheckedForUpdates = QDateTime.fromString(self.config["lastCheckedForUpdates"],'yyyy-MM-dd HH-mm-ss')
|
if self.lastCheckedForUpdates is None or configLastChecked > self.lastCheckedForUpdates.toPython():
|
||||||
if self.lastCheckedForUpdates is None:
|
self.lastCheckedForUpdates = QDateTime.fromString(self.config["lastCheckedForUpdates"],'yyyy-MM-dd HH-mm-ss')
|
||||||
self.checkForUpdates()
|
if self.lastCheckedForUpdates is None:
|
||||||
else:
|
|
||||||
timeDelta = currentDateTimeValue.toPython() - self.lastCheckedForUpdates.toPython()
|
|
||||||
if timeDelta.total_seconds() > constants.AUTOMATIC_UPDATE_CHECK_FREQUENCY:
|
|
||||||
self.checkForUpdates()
|
self.checkForUpdates()
|
||||||
|
else:
|
||||||
|
timeDelta = currentDateTimeValue.toPython() - self.lastCheckedForUpdates.toPython()
|
||||||
|
if timeDelta.total_seconds() > constants.AUTOMATIC_UPDATE_CHECK_FREQUENCY:
|
||||||
|
self.checkForUpdates()
|
||||||
|
except:
|
||||||
|
self.showDebugMessage(u"Automatic check for updates failed. An update check was manually trigggered.")
|
||||||
|
self.checkForUpdates()
|
||||||
|
|
||||||
def userCheckForUpdates(self):
|
def userCheckForUpdates(self):
|
||||||
self.checkForUpdates(userInitiated=True)
|
self.checkForUpdates(userInitiated=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user