Example #1
0
        public static VocaDbUrl GetUrl(this IEntryImageUrlFactory persister, IEntryImageInformation picture, ImageSize size, bool checkExists)
        {
            if (checkExists && !persister.HasImage(picture, size))
            {
                return(VocaDbUrl.Empty);
            }

            return(persister.GetUrl(picture, size));
        }
Example #2
0
        public static VocaDbUrl GetUrlWithFallback(this IEntryImageUrlFactory urlFactory, IEntryImageInformation imageInfo, ImageSize size, VocaDbUrl fallbackUrl)
        {
            if (imageInfo == null || !imageInfo.ShouldExist() || !urlFactory.HasImage(imageInfo, size))
            {
                return(fallbackUrl);
            }

            return(urlFactory.GetUrl(imageInfo, size));
        }