diff --git a/src/Stars.Data/Model/Metadata/Bka/BkaMetadataExtractor.cs b/src/Stars.Data/Model/Metadata/Bka/BkaMetadataExtractor.cs index 0d7c9f6c..8bbe45bc 100644 --- a/src/Stars.Data/Model/Metadata/Bka/BkaMetadataExtractor.cs +++ b/src/Stars.Data/Model/Metadata/Bka/BkaMetadataExtractor.cs @@ -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) @@ -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; } @@ -561,7 +561,7 @@ protected virtual IAsset GetProductZipAsset(IAsset topAsset, IAssetsContainer co protected virtual IEnumerable GetInnerZipAssets(IAssetsContainer container) { - IEnumerable zipAssets = FindAssetsFromFileNameRegex(container, @".*\.zip"); + IEnumerable zipAssets = FindAssetsFromFileNameRegex(container, @"^(?!.*(S2A_|S2B_)).*\.zip$"); return zipAssets; } diff --git a/src/Stars.Data/Model/Metadata/Inpe/InpeMetadataExtractor.cs b/src/Stars.Data/Model/Metadata/Inpe/InpeMetadataExtractor.cs index e5d34673..14d4cbd0 100644 --- a/src/Stars.Data/Model/Metadata/Inpe/InpeMetadataExtractor.cs +++ b/src/Stars.Data/Model/Metadata/Inpe/InpeMetadataExtractor.cs @@ -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; } } diff --git a/src/Stars.Data/Model/Metadata/Saocom1/Saocom1MetadataExtractor.cs b/src/Stars.Data/Model/Metadata/Saocom1/Saocom1MetadataExtractor.cs index c0a1bf00..e79b05e1 100644 --- a/src/Stars.Data/Model/Metadata/Saocom1/Saocom1MetadataExtractor.cs +++ b/src/Stars.Data/Model/Metadata/Saocom1/Saocom1MetadataExtractor.cs @@ -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; } @@ -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; }