Skip to content

Commit

Permalink
post collection with OnCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Jun 13, 2024
1 parent a085498 commit 05dd124
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ internal void UpdateLink(SyndicationLink link, AtomItem item, IAssetsContainer a
public string CatalogId { get; set; }

public List<string> AssetsFilters { get; set; }

public bool PublishCollections { get; set; } = false;
}

}
8 changes: 2 additions & 6 deletions src/Stars.Data/ThirdParty/Publication/GeosquareService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand All @@ -139,12 +141,6 @@ private async Task<object> 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;
}

Expand Down

0 comments on commit 05dd124

Please sign in to comment.