Example #1
0
 public RollSet(Roll roll)
     : this(new Roll[] {roll})
 {
 }
Example #2
0
        void ImportPhoto(IPhoto item, Roll roll)
        {
            if (item is IInvalidPhotoCheck && (item as IInvalidPhotoCheck).IsInvalid) {
                throw new Exception ("Failed to parse metadata, probably not a photo");
            }

            var destination = FindImportDestination (item);

            // Do duplicate detection
            if (DuplicateDetect && store.HasDuplicate (item)) {
                return;
            }

            // Copy into photo folder.
            CopyIfNeeded (item, destination);

            // Import photo
            var photo = store.CreateFrom (item, roll.Id);

            bool needs_commit = false;

            // Add tags
            if (attach_tags.Count > 0) {
                photo.AddTag (attach_tags);
                needs_commit = true;
            }

            // Import XMP metadata
            needs_commit |= metadata_importer.Import (photo, item);

            if (needs_commit) {
                store.Commit (photo);
            }

            // Prepare thumbnail (Import is I/O bound anyway)
            ThumbnailLoader.Default.Request (destination, ThumbnailSize.Large, 10);

            imported_photos.Add (photo.Id);
        }
Example #3
0
 public RollSet(Roll [] rolls)
 {
     this.rolls = rolls;
 }