Beispiel #1
0
        public async Task CheckForCompoundImageRequestFromCompoundImage(CompoundImageTagData compoundImageTagData)
        {
            if (await _tagsAnalyser.AnalyseTagConfidence(compoundImageTagData.Tags) == TagAnalysisAction.RequestCompoundImage)
            {
                var images = await _compoundImageMappingsRepository.GetImageIdsByCompoundImageId(compoundImageTagData.CompoundImageId);

                await _imagesService.CreateNewCompoundImage(compoundImageTagData.MapId, images);
            }
        }
        private async Task <bool> CompoundImageAlreadyExists(Guid mapId, IList <Guid> imageIds)
        {
            var compoundImagesForMap = await _compoundImagesRepository.GetByMapId(mapId);

            foreach (var compoundImage in compoundImagesForMap)
            {
                var imagesInCompoundImage = await _compoundImageMappingsRepository.GetImageIdsByCompoundImageId(compoundImage.Id);

                if (imagesInCompoundImage.All(imageIds.Contains))
                {
                    return(true);
                }
            }

            return(false);
        }