Skip to content

Commit

Permalink
ESACPE-2034 stac item now produced (titles to check)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlongobardo-gituname committed Aug 2, 2024
1 parent 12296b5 commit 9384bd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Stars.Data/Model/Metadata/Bka/BkaMetadataExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override bool CanProcess(IResource route, IDestination destination)
else
{
BkaMetadata[] metadata = ReadMetadata(metadataAssets).GetAwaiter().GetResult();
return metadata != null;
return metadata != null && metadata.Length > 0;
}
}
catch (Exception)
Expand Down Expand Up @@ -544,7 +544,7 @@ protected virtual IAsset[] GetMetadataAssets(IAssetsContainer container, IEnumer

protected virtual IAsset GetTopZipAsset(IItem item)
{
IAsset zipAsset = FindFirstAssetFromFileNameRegex(item, @".*\.zip");
IAsset zipAsset = FindFirstAssetFromFileNameRegex(item, @"^(?!.*(S2A_|S2B_)).*\.zip$");
return zipAsset;
}

Expand All @@ -561,7 +561,7 @@ protected virtual IAsset GetProductZipAsset(IAsset topAsset, IAssetsContainer co

protected virtual IEnumerable<IAsset> GetInnerZipAssets(IAssetsContainer container)
{
IEnumerable<IAsset> zipAssets = FindAssetsFromFileNameRegex(container, @".*\.zip");
IEnumerable<IAsset> zipAssets = FindAssetsFromFileNameRegex(container, @"^(?!.*(S2A_|S2B_)).*\.zip$");
return zipAssets;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Stars.Data/Model/Metadata/Inpe/InpeMetadataExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ public override bool CanProcess(IResource route, IDestination destination)
{
IAsset metadataAsset = GetMetadataAsset(item);
Schemas.Metadata metadata = ReadMetadata(metadataAsset).GetAwaiter().GetResult();
return metadata != null;

return true;
}
catch (Exception e)
{
Console.WriteLine("CAN NOT PROCESS: {0}\n{1}", e.Message, e.StackTrace);
//Console.WriteLine("CAN NOT PROCESS: {0}\n{1}", e.Message, e.StackTrace);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public override bool CanProcess(IResource route, IDestination destination)
else
{
SAOCOM_XMLProduct metadata = ReadMetadata(metadataAsset).GetAwaiter().GetResult();
return metadata != null;
}
return true;
}
Expand Down Expand Up @@ -696,7 +697,7 @@ protected virtual IAsset GetParametersAsset(IItem item)
protected virtual IAsset GetZipAsset(IItem item)
{
IAsset zipAsset = null;
zipAsset = FindFirstAssetFromFileNameRegex(item, @"S.*\.zip");
zipAsset = FindFirstAssetFromFileNameRegex(item, @"^(?!.*(S2A_|S2B_))S.*\.zip$");
return zipAsset;
}

Expand Down

0 comments on commit 9384bd7

Please sign in to comment.