diff --git a/app/src/main/java/io/xpipe/app/browser/LocalFileTransferStage.java b/app/src/main/java/io/xpipe/app/browser/LocalFileTransferStage.java index 699781ca..1b8f869d 100644 --- a/app/src/main/java/io/xpipe/app/browser/LocalFileTransferStage.java +++ b/app/src/main/java/io/xpipe/app/browser/LocalFileTransferStage.java @@ -52,7 +52,7 @@ public class LocalFileTransferStage { items.add(item); executor.submit(() -> { try { - FileUtils.forceMkdirParent(TEMP.toFile()); + FileUtils.forceMkdir(TEMP.toFile()); try (var b = new BusyProperty(downloading)) { FileSystemHelper.dropFilesInto(FileSystemHelper.getLocal(TEMP), List.of(entry), false); } diff --git a/app/src/main/java/io/xpipe/app/comp/about/UpdateCheckComp.java b/app/src/main/java/io/xpipe/app/comp/about/UpdateCheckComp.java index 52ed8c87..bcad935e 100644 --- a/app/src/main/java/io/xpipe/app/comp/about/UpdateCheckComp.java +++ b/app/src/main/java/io/xpipe/app/comp/about/UpdateCheckComp.java @@ -40,6 +40,11 @@ public class UpdateCheckComp extends SimpleComp { } private void restart() { + // Check if we're still on latest + if (!AppUpdater.get().isDownloadedUpdateStillLatest()) { + return; + } + AppUpdater.get().executeUpdateAndClose(); } diff --git a/app/src/main/java/io/xpipe/app/issue/TerminalErrorHandler.java b/app/src/main/java/io/xpipe/app/issue/TerminalErrorHandler.java index c6f5dbf7..133139b2 100644 --- a/app/src/main/java/io/xpipe/app/issue/TerminalErrorHandler.java +++ b/app/src/main/java/io/xpipe/app/issue/TerminalErrorHandler.java @@ -89,7 +89,7 @@ public class TerminalErrorHandler implements ErrorHandler { try { AppUpdater.init(); var rel = AppUpdater.get().checkForUpdate(true); - if (rel.isUpdate()) { + if (rel != null && rel.isUpdate()) { var update = AppWindowHelper.showBlockingAlert(alert -> { alert.setAlertType(Alert.AlertType.INFORMATION); alert.setTitle(AppI18n.get("updateAvailableTitle")); diff --git a/app/src/main/java/io/xpipe/app/update/AppUpdater.java b/app/src/main/java/io/xpipe/app/update/AppUpdater.java index 2f519374..f67831c1 100644 --- a/app/src/main/java/io/xpipe/app/update/AppUpdater.java +++ b/app/src/main/java/io/xpipe/app/update/AppUpdater.java @@ -101,8 +101,9 @@ public class AppUpdater { ThreadHelper.sleep(Duration.ofMinutes(10).toMillis()); event("Starting background updater thread"); while (true) { - if (INSTANCE.checkForUpdate(false) != null - && AppPrefs.get().automaticallyUpdate().get()) { + var rel = INSTANCE.checkForUpdate(false); + if (rel != null + && AppPrefs.get().automaticallyUpdate().get() && rel.isUpdate()) { event("Performing background update"); INSTANCE.downloadUpdate(); } @@ -226,7 +227,15 @@ public class AppUpdater { } public synchronized boolean isDownloadedUpdateStillLatest() { + if (downloadedUpdate.getValue() == null) { + return false; + } + var available = checkForUpdate(true); + if (available == null) { + return true; + } + return downloadedUpdate.getValue() != null && available.getVersion().equals(downloadedUpdate.getValue().getVersion()); } diff --git a/dist/changelogs/0.5.28.md b/dist/changelogs/0.5.28.md new file mode 100644 index 00000000..826e9f12 --- /dev/null +++ b/dist/changelogs/0.5.28.md @@ -0,0 +1,5 @@ +- Introduce new download functionality in the file browser +- Allow for the creation of desktop shortcuts on portable distributions as well +- Fix file sizes sometimes being incorrectly displayed +- Fix background updater downloading the same version +- Fix various small bugs \ No newline at end of file diff --git a/version b/version index 82591dbc..dc2c2a78 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.5.27 \ No newline at end of file +0.5.28 \ No newline at end of file