From 5dc711dd22ca053b55078d478acb84b5b82417f8 Mon Sep 17 00:00:00 2001 From: MichaelBuessemeyer <39529669+MichaelBuessemeyer@users.noreply.github.com> Date: Tue, 10 Dec 2024 09:45:53 +0100 Subject: [PATCH] Fix already upload of zarr datasets with already existing `datasource-properties.json` file (#8268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix already upload of zarr datasets with alread existing datasource-properties.json * undo changes to exploreLocalDatasource in upload service * add changelog entry --------- Co-authored-by: Michael Büßemeyer --- CHANGELOG.unreleased.md | 1 + .../datastore/services/uploading/UploadService.scala | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index b9f532e228..e443b28677 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -21,6 +21,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released ### Fixed - Fixed that listing datasets with the `api/datasets` route without compression failed due to missing permissions regarding public datasets. [#8249](https://github.com/scalableminds/webknossos/pull/8249) +- Fixed a bug that uploading a zarr dataset with an already existing `datasource-properties.json` file failed. [#8268](https://github.com/scalableminds/webknossos/pull/8268) - Fixed that the frontend did not ensure a minium length for annotation layer names. Moreover, names starting with a `.` are also disallowed now. [#8244](https://github.com/scalableminds/webknossos/pull/8244) - Fixed a bug where in the add remote dataset view the dataset name setting was not in sync with the datasource setting of the advanced tab making the form not submittable. [#8245](https://github.com/scalableminds/webknossos/pull/8245) - Fix read and update dataset route for versions 8 and lower. [#8263](https://github.com/scalableminds/webknossos/pull/8263) diff --git a/webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/uploading/UploadService.scala b/webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/uploading/UploadService.scala index 23f2781788..ec262c77e7 100644 --- a/webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/uploading/UploadService.scala +++ b/webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/uploading/UploadService.scala @@ -466,10 +466,10 @@ class UploadService @Inject()(dataSourceRepository: DataSourceRepository, } private def guessTypeOfUploadedDataSource(dataSourceDir: Path): UploadedDataSourceType.Value = - if (looksLikeZarrArray(dataSourceDir, maxDepth = 2).openOr(false)) { - UploadedDataSourceType.ZARR - } else if (looksLikeExploredDataSource(dataSourceDir).openOr(false)) { + if (looksLikeExploredDataSource(dataSourceDir).openOr(false)) { UploadedDataSourceType.EXPLORED + } else if (looksLikeZarrArray(dataSourceDir, maxDepth = 2).openOr(false)) { + UploadedDataSourceType.ZARR } else if (looksLikeZarrArray(dataSourceDir, maxDepth = 3).openOr(false)) { UploadedDataSourceType.ZARR_MULTILAYER } else if (looksLikeNeuroglancerPrecomputed(dataSourceDir, 1).openOr(false)) {