only log available update once
This commit is contained in:
parent
5fdb738886
commit
5b04257c9a
@ -124,7 +124,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
|||||||
$this->maniaControl->fileReader->loadFile($url, function ($dataJson, $error) use (&$function) {
|
$this->maniaControl->fileReader->loadFile($url, function ($dataJson, $error) use (&$function) {
|
||||||
$versions = json_decode($dataJson);
|
$versions = json_decode($dataJson);
|
||||||
if (!$versions || !isset($versions[0])) {
|
if (!$versions || !isset($versions[0])) {
|
||||||
call_user_func($function, null);
|
call_user_func($function);
|
||||||
} else {
|
} else {
|
||||||
$updateData = new UpdateData($versions[0]);
|
$updateData = new UpdateData($versions[0]);
|
||||||
call_user_func($function, $updateData);
|
call_user_func($function, $updateData);
|
||||||
@ -147,11 +147,11 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the fetched Update Data
|
* Handle the fetched Update Data of the hourly Check
|
||||||
*
|
*
|
||||||
* @param UpdateData $updateData
|
* @param UpdateData $updateData
|
||||||
*/
|
*/
|
||||||
public function handleUpdateCheck(UpdateData $updateData) {
|
public function handleUpdateCheck(UpdateData $updateData = null) {
|
||||||
if (!$this->checkUpdateData($updateData)) {
|
if (!$this->checkUpdateData($updateData)) {
|
||||||
// No new update available
|
// No new update available
|
||||||
return;
|
return;
|
||||||
@ -162,12 +162,14 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->isNightlyUpdateChannel()) {
|
if ($this->coreUpdateData != $updateData) {
|
||||||
$this->maniaControl->log("New Nightly Build ({$updateData->releaseDate}) available!");
|
if ($this->isNightlyUpdateChannel()) {
|
||||||
} else {
|
$this->maniaControl->log("New Nightly Build ({$updateData->releaseDate}) available!");
|
||||||
$this->maniaControl->log("New ManiaControl Version {$updateData->version} available!");
|
} else {
|
||||||
|
$this->maniaControl->log("New ManiaControl Version {$updateData->version} available!");
|
||||||
|
}
|
||||||
|
$this->setCoreUpdateData($updateData);
|
||||||
}
|
}
|
||||||
$this->setCoreUpdateData($updateData);
|
|
||||||
|
|
||||||
$this->checkAutoUpdate();
|
$this->checkAutoUpdate();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user