コード例 #1
0
 public JobCreatePhotoset(DC context, string fullPath, string name, string month, string year, string photoid, string story)
     : base(context, fullPath)
 {
     Photoset = new Album();
     Photoset.Name = name;
     Photoset.Month = month;
     Photoset.Year = year;
     Photoset.Story = story;
     m_photoid = photoid;
 }
コード例 #2
0
        protected override void FlickrExecuteOffThread()
        {
            try
            {
                FlickrNet.Photosets photosets = Flickr.PhotosetsGetList();
                if (photosets != null)
                {
                    foreach (var PS in photosets.PhotosetCollection)
                    {
                        Album A = new Album();

                        string s = PS.Title; // Format is Title(Month, Year)
                        var ss = s.Split('(');

                        A.Name = ss[0].Trim();

                        if (ss.Length == 2)
                        {
                            ss = ss[1].Split(',');
                            if (ss.Length == 2)
                            {
                                A.Month = Photo.FromMonth(ss[0]).ToString();

                                ss = ss[1].Split(')');
                                if (ss.Length == 2 && A.Month != "0")
                                {
                                    A.Year = ss[0];
                                    A.PhotosetId = PS.PhotosetId;
                                    Context.DSD.Albums.Add(A);
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
            }
        }
コード例 #3
0
 public JobUpdatePhotoWithPhotosetId(DC context, string fullPath, List<Photo> pl, Album a)
     : base(context, fullPath)
 {
     m_pl = pl;
     A = a;
 }
コード例 #4
0
 public bool AreEqual(Album other)
 {
     return (Name == other.Name && Month == other.Month && Year == other.Year);
 }
コード例 #5
0
        public string GetTags(Album A, List<string> ignorethese)
        {
            List<string> TagList = new List<string>();

            // Month, Date, Year
            if (DateStr != "")
            {
                try
                {
                    DateTime dt = DateTime.Parse(DateStr);
                    TagList.Add(Photo.GetMonth(dt.Month, ""));
                    TagList.Add(dt.Year.ToString());
                }
                catch
                {
                    TagList.Add(Photo.GetMonth(A.Month));
                    TagList.Add(A.Year);
                }
            }
            else
            {
                TagList.Add(Photo.GetMonth(A.Month));
                TagList.Add(A.Year);
            }

            // Title
            AddWordsFromStringToList(TagList, ignorethese, Title);

            // People
            AddNamesFromStringToList(TagList, People);

            // Album Title
            AddWordsFromStringToList(TagList, ignorethese, AlbumT);

            // Place
            AddWordsFromStringToList(TagList, ignorethese, Place);

            // Album story
            AddWordsFromStringToList(TagList, ignorethese, A.Story);

            return ListToString(TagList);
        }
コード例 #6
0
 protected void UpdateLocationInformation(Album album)
 {
     Place placeforphoto = null;
     var places = from PL in Context.DSD.Places where PL.Name == _photo.Place select PL;
     foreach (var place in places)
     {
         placeforphoto = place;
         break;
     }
     if (placeforphoto != null)
     {
         try
         {
             Flickr.PhotosGeoSetLocation(_photo.FlickrId, placeforphoto.Latitude, placeforphoto.Longitude, FlickrNet.GeoAccuracy.City);
         }
         catch
         {
             // Consume any exceptions setting the location...
         }
     }
     try
     {
         Flickr.PhotosAddTags(_photo.FlickrId, _photo.GetTags(album, Context.DSD.IgnoreWords));
         UpdateFaceTags(_photo.FlickrId);
     }
     catch
     {
     }
 }
コード例 #7
0
ファイル: DC.cs プロジェクト: nagyist/FlickrUploader
 public void AddUpdatePhotoWithPhotosetIdJob(Album A)
 {
     JobUpdatePhotoWithPhotosetId jupwpi = new JobUpdatePhotoWithPhotosetId(this, CurrentDirectory.DI.FullName, CurrentDirectory.Photos, A);
     WorkToDo.Add(jupwpi);
 }