Exemple #1
0
 /// <summary>
 /// Run ExifTool
 /// </summary>
 /// <param name="exifTool">ExifTool Abstraction</param>
 /// <param name="iStorage">Source storage provider</param>
 /// <param name="thumbnailStorage">Thumbnail Storage Abstraction provider</param>
 /// <param name="readMeta">ReadMeta abstraction</param>
 public ExifToolCmdHelper(IExifTool exifTool, IStorage iStorage, IStorage thumbnailStorage, IReadMeta readMeta)
 {
     _exifTool         = exifTool;
     _iStorage         = iStorage;
     _readMeta         = readMeta;
     _thumbnailStorage = thumbnailStorage;
 }
Exemple #2
0
 public ExifCopy(IStorage iStorage, IStorage thumbnailStorage, IExifTool exifTool, IReadMeta readMeta)
 {
     _iStorage         = iStorage;
     _exifTool         = exifTool;
     _readMeta         = readMeta;
     _thumbnailStorage = thumbnailStorage;
 }
Exemple #3
0
        public Import(
            ISelectorStorage selectorStorage,
            AppSettings appSettings,
            IImportQuery importQuery,
            IExifTool exifTool,
            IQuery query,
            IConsole console,
            IMetaExifThumbnailService metaExifThumbnailService,
            IWebLogger logger,
            IMemoryCache?memoryCache = null)
        {
            _importQuery = importQuery;

            _filesystemStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
            _subPathStorage    = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
            _thumbnailStorage  = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);

            _appSettings                 = appSettings;
            _readMetaHost                = new ReadMeta(_filesystemStorage, appSettings);
            _exifTool                    = exifTool;
            _query                       = query;
            _console                     = console;
            _metaExifThumbnailService    = metaExifThumbnailService;
            _memoryCache                 = memoryCache;
            _logger                      = logger;
            _updateImportTransformations = new UpdateImportTransformations(logger, _exifTool, selectorStorage, appSettings);
        }
Exemple #4
0
 public GeoBackgroundTask(AppSettings appSettings, ISelectorStorage selectorStorage,
                          IGeoLocationWrite geoLocationWrite, IMemoryCache memoryCache,
                          IWebLogger logger, IGeoReverseLookup geoReverseLookup)
 {
     _appSettings      = appSettings;
     _iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _readMeta         = new ReadMeta(_iStorage);
     _geoLocationWrite = geoLocationWrite;
     _logger           = logger;
     _geoIndexGpx      = new GeoIndexGpx(_appSettings, _iStorage, memoryCache);
     _geoReverseLookup = geoReverseLookup;
 }
Exemple #5
0
 public GeoCli(IGeoReverseLookup geoReverseLookup,
               IGeoLocationWrite geoLocationWrite, ISelectorStorage selectorStorage, AppSettings appSettings, IConsole console,
               IGeoFileDownload geoFileDownload, IExifToolDownload exifToolDownload)
 {
     _geoReverseLookup = geoReverseLookup;
     _geoLocationWrite = geoLocationWrite;
     _iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _readMeta         = new ReadMeta(_iStorage, appSettings);
     _appSettings      = appSettings;
     _console          = console;
     _exifToolDownload = exifToolDownload;
     _geoFileDownload  = geoFileDownload;
 }
Exemple #6
0
 public NewItem(IStorage subPathStorage, IReadMeta readMeta)
 {
     _subPathStorage = subPathStorage;
     _readMeta       = readMeta;
 }
Exemple #7
0
 public App(IConfigurationRoot config, IReadMeta readMeta, IRotate rotate)
 {
     _config   = config;
     _readMeta = readMeta;
     _rotate   = rotate;
 }
 public FakeReadMetaSubPathStorage()
 {
     _readMeta = new FakeReadMeta();
 }
Exemple #9
0
        public DeleteControllerTest()
        {
            var provider = new ServiceCollection()
                           .AddMemoryCache()
                           .BuildServiceProvider();
            var memoryCache = provider.GetService <IMemoryCache>();

            var builderDb = new DbContextOptionsBuilder <ApplicationDbContext>();

            builderDb.UseInMemoryDatabase("test1234");
            var options = builderDb.Options;

            _context = new ApplicationDbContext(options);
            _query   = new Query(_context,
                                 new AppSettings(), null, new FakeIWebLogger(), memoryCache);

            // Inject Fake ExifTool; dependency injection
            var services = new ServiceCollection();

            // Fake the readMeta output
            services.AddSingleton <IReadMeta, FakeReadMeta>();

            // Inject Config helper
            services.AddSingleton <IConfiguration>(new ConfigurationBuilder().Build());
            // random config
            _createAnImage = new CreateAnImage();
            var dict = new Dictionary <string, string>
            {
                { "App:StorageFolder", _createAnImage.BasePath },
                { "App:ThumbnailTempFolder", _createAnImage.BasePath },
                { "App:Verbose", "true" }
            };
            // Start using dependency injection
            var builder = new ConfigurationBuilder();

            // Add random config to dependency injection
            builder.AddInMemoryCollection(dict);
            // build config
            var configuration = builder.Build();

            // inject config as object to a service
            services.ConfigurePoCo <AppSettings>(configuration.GetSection("App"));

            // Add Background services
            services.AddSingleton <IHostedService, UpdateBackgroundQueuedHostedService>();
            services.AddSingleton <IUpdateBackgroundTaskQueue, UpdateBackgroundTaskQueue>();

            // build the service
            var serviceProvider = services.BuildServiceProvider();

            // get the service
            _appSettings = serviceProvider.GetRequiredService <AppSettings>();

            // inject fake exiftool
            _exifTool = new FakeExifTool(_iStorage, _appSettings);

            _readmeta     = serviceProvider.GetRequiredService <IReadMeta>();
            _scopeFactory = serviceProvider.GetRequiredService <IServiceScopeFactory>();


            // get the background helper
            _bgTaskQueue = serviceProvider.GetRequiredService <IUpdateBackgroundTaskQueue>();

            _iStorage = new StorageSubPathFilesystem(_appSettings, new FakeIWebLogger());
        }