Exemplo n.º 1
0
 public MediaFilterBuilder(
     MediaStoreContext dbContext,
     Func <Guid, CancellationToken, Task <IEnumerable <Guid> > >?albumMediaResolver,
     CancellationToken cancellationToken)
 {
     _filter             = Builders <Media> .Filter.Empty;
     _tasks              = new();
     _dbContext          = dbContext;
     _albumMediaResolver = albumMediaResolver;
     _cancellationToken  = cancellationToken;
 }
Exemplo n.º 2
0
 public MongoMediaStore(
     MediaStoreContext mediaStoreContext,
     IThumbnailBlobStore thumbnailBlobStore,
     IMediaBlobStore blobStore,
     IFaceStore faceStore,
     IAlbumStore albumStore,
     ICameraStore cameraStore,
     IPersonStore personStore)
 {
     _mediaStoreContext = mediaStoreContext;
     Thumbnails         = thumbnailBlobStore;
     Blob    = blobStore;
     Faces   = faceStore;
     Albums  = albumStore;
     Cameras = cameraStore;
     Persons = personStore;
 }
        public static IServiceCollection AddMongoDbStore(
            this IServiceCollection services,
            IConfiguration configuration)
        {
            MongoOptions options = configuration.GetSection("MagicMedia:Database")
                                   .Get <MongoOptions>();

            services.AddSingleton(new MediaStoreContext(options));
            services.AddSingleton <IThumbnailBlobStore>((c) =>
            {
                MediaStoreContext mongoCtx = c.GetService <MediaStoreContext>();
                return(new GridFsThumbnailStore(mongoCtx.CreateGridFsBucket()));
            });

            services.AddSingleton <IMediaStore, MongoMediaStore>();
            services.AddSingleton <IFaceStore, FaceStore>();
            services.AddSingleton <ICameraStore, CameraStore>();
            services.AddSingleton <IPersonStore, PersonStore>();
            services.AddSingleton <IGroupStore, GroupStore>();
            services.AddSingleton <IAlbumStore, AlbumStore>();

            return(services);
        }
Exemplo n.º 4
0
 public GroupStore(MediaStoreContext mediaStoreContext)
 {
     _mediaStoreContext = mediaStoreContext;
 }
Exemplo n.º 5
0
 public MediaAIStore(MediaStoreContext mediaStoreContext)
 {
     _mediaStoreContext = mediaStoreContext;
 }
Exemplo n.º 6
0
 public GeoDecoderCacheStore(MediaStoreContext mediaStoreContext, IGeoDecoderService geoDecoderService)
 {
     _mediaStoreContext = mediaStoreContext;
     _geoDecoderService = geoDecoderService;
 }
Exemplo n.º 7
0
 public CameraStore(MediaStoreContext mediaStoreContext)
 {
     _mediaStoreContext = mediaStoreContext;
 }
Exemplo n.º 8
0
 public PersonStore(MediaStoreContext mediaStoreContext)
 {
     _mediaStoreContext = mediaStoreContext;
 }
Exemplo n.º 9
0
 public AlbumStore(MediaStoreContext mediaStoreContext)
 {
     _mediaStoreContext = mediaStoreContext;
 }
Exemplo n.º 10
0
 public FaceStore(MediaStoreContext mediaStoreContext)
 {
     _mediaStoreContext = mediaStoreContext;
 }