Skip to content

Commit b04a44b

Browse files
committed
Use the version number when checking the appstore for compatible updates
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 90a35aa commit b04a44b

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

apps/updatenotification/js/updatenotification.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/updatenotification/js/updatenotification.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/updatenotification/lib/Command/Check.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
6767
// Server
6868
$r = $this->updateChecker->getUpdateState();
6969
if (isset($r['updateAvailable']) && $r['updateAvailable']) {
70-
$output->writeln($r['updateVersion'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.');
70+
$output->writeln($r['updateVersionString'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.');
7171
$updatesAvailableCount += 1;
7272
}
7373

apps/updatenotification/lib/Settings/Admin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ public function getForm(): TemplateResponse {
9797
'lastChecked' => $lastUpdateCheck,
9898
'currentChannel' => $currentChannel,
9999
'channels' => $channels,
100-
'newVersionString' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'],
100+
'newVersion' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'],
101+
'newVersionString' => empty($updateState['updateVersionString']) ? '' : $updateState['updateVersionString'],
101102
'downloadLink' => empty($updateState['downloadLink']) ? '' : $updateState['downloadLink'],
102103
'changes' => $this->filterChanges($updateState['changes'] ?? []),
103104
'updaterEnabled' => empty($updateState['updaterEnabled']) ? false : $updateState['updaterEnabled'],

apps/updatenotification/lib/UpdateChecker.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public function getUpdateState(): array {
5151

5252
if (isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) {
5353
$result['updateAvailable'] = true;
54-
$result['updateVersion'] = $data['versionstring'];
54+
$result['updateVersion'] = $data['version'];
55+
$result['updateVersionString'] = $data['versionstring'];
5556
$result['updaterEnabled'] = $data['autoupdater'] === '1';
5657
$result['versionIsEol'] = $data['eol'] === '1';
5758
if (strpos($data['web'], 'https://') === 0) {
@@ -80,7 +81,7 @@ public function getUpdateState(): array {
8081
public function populateJavaScriptVariables(array $data) {
8182
$data['array']['oc_updateState'] = json_encode([
8283
'updateAvailable' => true,
83-
'updateVersion' => $this->getUpdateState()['updateVersion'],
84+
'updateVersion' => $this->getUpdateState()['updateVersionString'],
8485
'updateLink' => $this->getUpdateState()['updateLink'] ?? '',
8586
]);
8687
}

0 commit comments

Comments
 (0)