From 05dd124a47d406b7af8ecb54f38eccbd6b66e9b4 Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Thu, 13 Jun 2024 11:50:49 +0200 Subject: [PATCH 1/2] post collection with OnCollection --- .../ThirdParty/Publication/GeosquarePublicationModel.cs | 2 ++ src/Stars.Data/ThirdParty/Publication/GeosquareService.cs | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Stars.Data/ThirdParty/Publication/GeosquarePublicationModel.cs b/src/Stars.Data/ThirdParty/Publication/GeosquarePublicationModel.cs index f78f45da..2a3f0d1e 100644 --- a/src/Stars.Data/ThirdParty/Publication/GeosquarePublicationModel.cs +++ b/src/Stars.Data/ThirdParty/Publication/GeosquarePublicationModel.cs @@ -118,6 +118,8 @@ internal void UpdateLink(SyndicationLink link, AtomItem item, IAssetsContainer a public string CatalogId { get; set; } public List AssetsFilters { get; set; } + + public bool PublishCollections { get; set; } = false; } } diff --git a/src/Stars.Data/ThirdParty/Publication/GeosquareService.cs b/src/Stars.Data/ThirdParty/Publication/GeosquareService.cs index 5563a8c2..f053dc46 100644 --- a/src/Stars.Data/ThirdParty/Publication/GeosquareService.cs +++ b/src/Stars.Data/ThirdParty/Publication/GeosquareService.cs @@ -129,6 +129,8 @@ private void InitRoutingTask(GeosquarePublicationModel geosquareModel) // routingService.OnRoutingException((route, router, exception, state) => PrintRouteInfo(route, router, exception, state)); routingService.OnBeforeBranching((node, router, state, subroutes, ct) => OnBeforeBranching(node, router, state, subroutes, ct)); routingService.OnItem((node, router, state, ct) => PostItemToCatalog(node, router, state, ct)); + if (geosquareModel.PublishCollections) + routingService.OnCollection((node, router, state, ct) => PostCollectionToCatalog(node, router, state, ct)); // routingService.OnBranching((parentRoute, route, siblings, state) => PrepareNewRoute(parentRoute, route, siblings, state)); } @@ -139,12 +141,6 @@ private async Task OnBeforeBranching(ICatalog node, IRouter router, obje return state; } - // If Collection has assets, we consider it as a single item - if (collection.Assets.Count > 0) - { - await PostCollectionToCatalog(new StacCollectionNode(collection, node.Uri), router, state, ct); - } - return state; } From 42cd2fc1adcc154790d9bda1ed54a76774d4f1c0 Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Thu, 13 Jun 2024 11:52:03 +0200 Subject: [PATCH 2/2] chore: Bump version to 2.24.2 --- CHANGELOG.md | 8 +++++++- src/Stars.Console/Terradue.Stars.Console.csproj | 2 +- src/Stars.Data/Terradue.Stars.Data.csproj | 2 +- src/Stars.Services/Terradue.Stars.Services.csproj | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc0d6bf3..30ea994e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -## [2.24.1](https://github.com/Terradue/Stars/compare/2.24.0...2.24.1) +## [2.24.2](https://github.com/Terradue/Stars/compare/2.24.1...2.24.2) + +### Commits + +- post collection with OnCollection [`05dd124`](https://github.com/Terradue/Stars/commit/05dd124a47d406b7af8ecb54f38eccbd6b66e9b4) + +## [2.24.1](https://github.com/Terradue/Stars/compare/2.24.0...2.24.1) - 2024-06-04 ### Commits diff --git a/src/Stars.Console/Terradue.Stars.Console.csproj b/src/Stars.Console/Terradue.Stars.Console.csproj index 5c6b4df2..268dc13d 100644 --- a/src/Stars.Console/Terradue.Stars.Console.csproj +++ b/src/Stars.Console/Terradue.Stars.Console.csproj @@ -2,7 +2,7 @@ Exe net6.0 - 2.24.1 + 2.24.2 Stars is a CLI for working with Spatio Temporal Catalog such as STAC but not only $(Version)-$(VersionSuffix) diff --git a/src/Stars.Data/Terradue.Stars.Data.csproj b/src/Stars.Data/Terradue.Stars.Data.csproj index e4a6610b..8d144ea0 100644 --- a/src/Stars.Data/Terradue.Stars.Data.csproj +++ b/src/Stars.Data/Terradue.Stars.Data.csproj @@ -4,7 +4,7 @@ Terradue.Stars.Data Terradue.Stars.Data Collection of data Plugins for Terradue.Stars - 2.24.1 + 2.24.2 $(Version)-$(VersionSuffix) NU1603 diff --git a/src/Stars.Services/Terradue.Stars.Services.csproj b/src/Stars.Services/Terradue.Stars.Services.csproj index 50ab8dc0..29e998e1 100644 --- a/src/Stars.Services/Terradue.Stars.Services.csproj +++ b/src/Stars.Services/Terradue.Stars.Services.csproj @@ -3,7 +3,7 @@ netstandard2.0 Terradue.Stars Stars is a set of services for working with Spatio Temporal Catalog such as STAC but not only - 2.24.1 + 2.24.2 $(Version)-$(VersionSuffix) Terradue.Stars.Services