Skip to content

Commit

Permalink
Treat zero layer dataset as unusable (#4959)
Browse files Browse the repository at this point in the history
* treat zero layer dataset as unusable

* update changelog
  • Loading branch information
youri-k authored Dec 3, 2020
1 parent e099c57 commit 5c330dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
[Commits](https://github.com/scalableminds/webknossos/compare/20.12.0...HEAD)

### Added
-
- Datasets without any layer are now considered unimported. [#4959](https://github.com/scalableminds/webknossos/pull/4959)

### Changed
- The menu for viewing, editing and creating annotations for a dataset in the dashboard was cleaned up a bit. Creating a hybrid (skeleton + volume) annotation is now the default way of annotating a dataset. The other options are still available via a dropdown. [#4939](https://github.com/scalableminds/webknossos/pull/4939)
Expand Down
2 changes: 1 addition & 1 deletion app/models/binary/DataSet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class DataSetDataLayerDAO @Inject()(sqlClient: SQLClient, dataSetResolutionsDAO:
val clearQuery = sqlu"delete from webknossos.dataset_layers where _dataSet = ${_dataSet}"

val queries = source.toUsable match {
case Some(usable) if usable.dataLayers.nonEmpty =>
case Some(usable) =>
getSpecificClearQuery(usable.dataLayers) :: usable.dataLayers.map(insertLayerQuery(_dataSet, _))
case _ => List(clearQuery)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ class DataSourceService @Inject()(
if (new File(propertiesFile.toString).exists()) {
JsonHelper.validatedJsonFromFile[DataSource](propertiesFile, path) match {
case Full(dataSource) =>
dataSource.copy(id)
if (dataSource.dataLayers.nonEmpty) dataSource.copy(id)
else UnusableDataSource(id, "Error: Zero layer Dataset")
case e =>
UnusableDataSource(id, s"Error: Invalid json format in $propertiesFile: $e")
}
Expand Down

0 comments on commit 5c330dc

Please sign in to comment.