Exemplo n.º 1
0
 public PictureInfo GetAllImageLinks(IPhotoInformation photoInformation)
 {
     return(new()
     {
         OriginalLink = GetOriginal(photoInformation),
         ThumbnailLink = GetThumbnail(photoInformation),
         WebsiteLink = GetWebsiteLink(photoInformation)
     });
 }
Exemplo n.º 2
0
 public Photo(string id, Location location, IPhotoInformation photoInformation, IEnumerable <Bird> birds, DateTime dateTaken, double ratio, string description)
 {
     Id               = id;
     Location         = location;
     PhotoInformation = photoInformation;
     DateTaken        = dateTaken;
     Ratio            = ratio;
     Description      = description;
     Birds            = birds;
 }
Exemplo n.º 3
0
        private string GetFlickrImageUrl(IPhotoInformation photoInformation, string postfix)
        {
            if (photoInformation == null)
            {
                return(string.Empty);
            }

            var farmId   = photoInformation.Metadata["FarmId"];
            var serverId = photoInformation.Metadata["ServerId"];
            var secret   = photoInformation.Metadata["Secret"];

            return($"https://farm{farmId}.staticflickr.com/{serverId}/{photoInformation.Id}_{secret}{postfix}.jpg");
        }
Exemplo n.º 4
0
 public string GetWebsiteLink(IPhotoInformation photoInformation)
 {
     return($"https://www.flickr.com/photos/{_appSettings.FlickrUserId}/{photoInformation.Id}");
 }
Exemplo n.º 5
0
 public string GetThumbnail(IPhotoInformation photoInformation) => GetFlickrImageUrl(photoInformation, "_n");
Exemplo n.º 6
0
 public string GetOriginal(IPhotoInformation photoInformation) => GetFlickrImageUrl(photoInformation, "_h");