예제 #1
0
        private IEnumerable<Flick> GetNewPosts(IEnumerable<Flick> existedPhotos)
        {
            var photos = GetAvailablePhotos();

            Logger.Trace("Flickr serivce : available photos : " + photos.Count);

            var newPhotos = new List<Flick>();

            foreach (var photo in photos)
            {
                if (existedPhotos.All(x => x.FlickrId != photo.PhotoId))
                {
                    var photoInfo = FlickrClient.PhotosGetInfo(photo.PhotoId, photo.Secret);

                    var flick = new Flick(this)
                    {
                        FlickrId = photo.PhotoId,
                        Title = photo.Title,
                        Description = photoInfo.Description,
                        Secret = photo.Secret,
                        FarmId = photo.Farm,
                        ServerId = photo.Server,
                    };

                    foreach (var tag in photoInfo.Tags)
                    {
                        if (tag.AuthorId == Settings.Flickr.UserId)
                            flick.AddTag(tag.TagText);
                    }

                    newPhotos.Add(flick);
                }
            }

            return newPhotos;
        }
예제 #2
0
        public void UpdatePhoto(Flick photo)
        {
            var photoInfo = FlickrClient.PhotosGetInfo(photo.FlickrId, photo.Secret);

            photo.Title = photoInfo.Title;
            photo.Description = photoInfo.Description;

            foreach (var tag in photoInfo.Tags)
            {
                if (tag.AuthorId == Settings.Flickr.UserId)
                    photo.AddTag(tag.TagText);
            }
        }