public DownloadPhotoController(IQuery query, ISelectorStorage selectorStorage, IWebLogger logger)
 {
     _query            = query;
     _iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _logger           = logger;
 }
Exemple #2
0
        public ThumbnailService(ISelectorStorage selectorStorage, IWebLogger logger)
        {
            var iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
            var thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);

            _thumbnail = new Thumbnail(iStorage, thumbnailStorage, logger);
        }
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 DeleteItem(IQuery query, AppSettings appSettings, ISelectorStorage selectorStorage)
 {
     _query            = query;
     _iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _statusCodeHelper = new StatusCodesHelper(appSettings);
 }
Exemple #5
0
        public ExifToolService(ISelectorStorage selectorStorage, AppSettings appSettings, IWebLogger logger)
        {
            var iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
            var thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);

            _exifTool = new ExifTool(iStorage, thumbnailStorage, appSettings, logger);
        }
Exemple #6
0
 public GeoLocationWrite(AppSettings appSettings, IExifTool exifTool, ISelectorStorage selectorStorage, IConsole console)
 {
     _exifTool         = exifTool;
     _appSettings      = appSettings;
     _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _console          = console;
 }
Exemple #7
0
        public ExifToolHostStorageService(ISelectorStorage selectorStorage, AppSettings appSettings, IWebLogger webLogger)
        {
            var iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
            var thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);

            _exifTool  = new ExifTool(iStorage, thumbnailStorage, appSettings, _webLogger);
            _webLogger = webLogger;
        }
Exemple #8
0
        public async Task Thumbnail(string[] args)
        {
            _appSettings.Verbose         = ArgsHelper.NeedVerbose(args);
            _appSettings.ApplicationType = AppSettings.StarskyAppType.Thumbnail;

            if (new ArgsHelper().NeedHelp(args))
            {
                new ArgsHelper(_appSettings, _console).NeedHelpShowDialog();
                return;
            }

            new ArgsHelper().SetEnvironmentByArgs(args);

            var subPath            = new ArgsHelper(_appSettings).SubPathOrPathValue(args);
            var getSubPathRelative = new ArgsHelper(_appSettings).GetRelativeValue(args);

            if (getSubPathRelative != null)
            {
                subPath = new StructureService(_selectorStorage.Get(
                                                   SelectorStorage.StorageServices.SubPath), _appSettings.Structure)
                          .ParseSubfolders(getSubPathRelative);
            }

            if (new ArgsHelper(_appSettings).GetThumbnail(args))
            {
                var storage = _selectorStorage.Get(SelectorStorage.StorageServices.SubPath);

                var isFolderOrFile = storage.IsFolderOrFile(subPath);

                if (_appSettings.IsVerbose())
                {
                    _console.WriteLine(isFolderOrFile.ToString());
                }

                if (isFolderOrFile == FolderOrFileModel.FolderOrFileTypeList.File)
                {
                    // If single file => create thumbnail
                    var fileHash = (await new FileHash(storage).GetHashCodeAsync(subPath));
                    if (fileHash.Value)
                    {
                        await _thumbnailService.CreateThumb(subPath, fileHash.Key);                         // <= this uses subPath
                    }
                }
                else
                {
                    await _thumbnailService.CreateThumb(subPath);
                }
                _console.WriteLine("Thumbnail Done!");
            }

            if (new ArgsHelper(_appSettings).NeedCleanup(args))
            {
                _console.WriteLine(">>>>> Heavy CPU Feature => NeedCacheCleanup <<<<< ");
                await _thumbnailCleaner.CleanAllUnusedFilesAsync();

                _console.WriteLine("Done!");
            }
        }
 public UpdateImportTransformations(IWebLogger logger,
                                    IExifTool exifTool, ISelectorStorage selectorStorage, AppSettings appSettings)
 {
     _logger           = logger;
     _exifTool         = exifTool;
     _subPathStorage   = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _appSettings      = appSettings;
 }
Exemple #10
0
 public ExportService(IQuery query, AppSettings appSettings,
                      ISelectorStorage selectorStorage, IWebLogger logger)
 {
     _appSettings           = appSettings;
     _query                 = query;
     _iStorage              = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage      = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _hostFileSystemStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
     _logger                = logger;
 }
Exemple #11
0
 public PublishCli(ISelectorStorage storageSelector, IPublishPreflight publishPreflight,
                   IWebHtmlPublishService publishService, AppSettings appSettings, IConsole console)
 {
     _publishPreflight      = publishPreflight;
     _publishService        = publishService;
     _appSettings           = appSettings;
     _console               = console;
     _argsHelper            = new ArgsHelper(appSettings, console);
     _hostFileSystemStorage = storageSelector.Get(SelectorStorage.StorageServices.HostFilesystem);
     _subPathStorage        = storageSelector.Get(SelectorStorage.StorageServices.SubPath);
 }
Exemple #12
0
 public OverlayImage(ISelectorStorage selectorStorage, AppSettings appSettings)
 {
     _appSettings = appSettings;
     if (selectorStorage == null)
     {
         return;
     }
     _iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _hostFileSystem   = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
 }
 public MetaExifThumbnailService(AppSettings appSettings, ISelectorStorage selectorStorage,
                                 IOffsetDataMetaExifThumbnail offsetDataMetaExifThumbnail,
                                 IWriteMetaThumbnailService writeMetaThumbnailService, IWebLogger logger)
 {
     _appSettings                 = appSettings;
     _iStorage                    = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage            = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _offsetDataMetaExifThumbnail = offsetDataMetaExifThumbnail;
     _writeMetaThumbnailService   = writeMetaThumbnailService;
     _logger = logger;
 }
Exemple #14
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 #15
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 #16
0
 public ImportController(IImport import, AppSettings appSettings,
                         IUpdateBackgroundTaskQueue queue,
                         IHttpClientHelper httpClientHelper, ISelectorStorage selectorStorage,
                         IServiceScopeFactory scopeFactory, IWebLogger logger)
 {
     _appSettings           = appSettings;
     _import                = import;
     _bgTaskQueue           = queue;
     _httpClientHelper      = httpClientHelper;
     _selectorStorage       = selectorStorage;
     _hostFileSystemStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
     _thumbnailStorage      = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _scopeFactory          = scopeFactory;
     _logger                = logger;
 }
Exemple #17
0
 public UploadController(IImport import, AppSettings appSettings,
                         ISelectorStorage selectorStorage, IQuery query,
                         IRealtimeConnectionsService connectionsService, IWebLogger logger,
                         IMetaExifThumbnailService metaExifThumbnailService)
 {
     _appSettings              = appSettings;
     _import                   = import;
     _query                    = query;
     _selectorStorage          = selectorStorage;
     _iStorage                 = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _iHostStorage             = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
     _connectionsService       = connectionsService;
     _logger                   = logger;
     _metaExifThumbnailService = metaExifThumbnailService;
 }
Exemple #18
0
        public async Task <IActionResult> ThumbnailGeneration(string f)
        {
            var subPath          = f != "/" ? PathHelper.RemoveLatestSlash(f) : "/";
            var subPathStorage   = _selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
            var thumbnailStorage = _selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);

            if (!subPathStorage.ExistFolder(subPath))
            {
                return(NotFound("folder not found"));
            }

            await Task.Factory.StartNew(() => WorkItem(subPath, subPathStorage, thumbnailStorage));

            return(Json("Job started"));
        }
Exemple #19
0
        public async Task CommandLineAsync(string[] args)
        {
            _appSettings.Verbose         = ArgsHelper.NeedVerbose(args);
            _appSettings.ApplicationType = AppSettings.StarskyAppType.MetaThumbnail;

            if (new ArgsHelper().NeedHelp(args))
            {
                new ArgsHelper(_appSettings, _console).NeedHelpShowDialog();
                return;
            }

            new ArgsHelper().SetEnvironmentByArgs(args);

            var subPath            = new ArgsHelper(_appSettings).SubPathOrPathValue(args);
            var getSubPathRelative = new ArgsHelper(_appSettings).GetRelativeValue(args);

            if (getSubPathRelative != null)
            {
                subPath = new StructureService(_selectorStorage.Get(SelectorStorage.StorageServices.SubPath), _appSettings.Structure)
                          .ParseSubfolders(getSubPathRelative);
            }

            await _metaExifThumbnailService.AddMetaThumbnail(subPath);

            _console.WriteLine("Done!");
        }
Exemple #20
0
        /// <summary>
        /// Export Values to Storage
        /// </summary>
        /// <param name="appSettings">App Settings</param>
        /// <param name="selectorStorage">Storage Provider</param>
        /// <param name="swaggerProvider">Swagger</param>
        /// <exception cref="ArgumentNullException">swaggerJsonText = null</exception>
        public bool Add03AppExport(AppSettings appSettings, ISelectorStorage selectorStorage, ISwaggerProvider swaggerProvider)
        {
            if (appSettings.AddSwagger != true || appSettings.AddSwaggerExport != true)
            {
                return(false);
            }

            var swaggerJsonText = GenerateSwagger(swaggerProvider, appSettings.Name);

            if (string.IsNullOrEmpty(swaggerJsonText))
            {
                throw new ArgumentException("swaggerJsonText = null", nameof(swaggerProvider));
            }

            var swaggerJsonFullPath =
                Path.Join(appSettings.TempFolder, appSettings.Name.ToLowerInvariant() + ".json");

            var storage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);

            storage.FileDelete(swaggerJsonFullPath);
            storage.WriteStream(new PlainTextFileHelper().StringToStream(swaggerJsonText),
                                swaggerJsonFullPath);

            _logger?.LogInformation($"app__addSwaggerExport {swaggerJsonFullPath}");
            return(true);
        }
Exemple #21
0
 public MetaUpdateService(
     IQuery query,
     IExifTool exifTool,
     ISelectorStorage selectorStorage,
     IMetaPreflight metaPreflight,
     IWebLogger logger,
     IReadMetaSubPathStorage readMetaSubPathStorage)
 {
     _query            = query;
     _exifTool         = exifTool;
     _iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _readMeta         = readMetaSubPathStorage;
     _metaPreflight    = metaPreflight;
     _logger           = logger;
 }
Exemple #22
0
 public MetaInfo(IQuery query, AppSettings appSettings, ISelectorStorage selectorStorage, IMemoryCache memoryCache)
 {
     _query            = query;
     _iStorage         = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _readMeta         = new ReadMeta(_iStorage, appSettings, memoryCache);
     _statusCodeHelper = new StatusCodesHelper(appSettings);
 }
Exemple #23
0
 public AccountController(IUserManager userManager, AppSettings appSettings, IAntiforgery antiForgery, ISelectorStorage selectorStorage)
 {
     _userManager = userManager;
     _appSettings = appSettings;
     _antiForgery = antiForgery;
     _storageHostFullPathFilesystem = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
 }
Exemple #24
0
 public ExportController(IUpdateBackgroundTaskQueue queue,
                         ISelectorStorage selectorStorage, IExport export)
 {
     _bgTaskQueue           = queue;
     _hostFileSystemStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
     _export = export;
 }
Exemple #25
0
 public DiskController(IQuery query, ISelectorStorage selectorStorage,
                       IWebSocketConnectionsService connectionsService, INotificationQuery notificationQuery)
 {
     _query              = query;
     _iStorage           = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _connectionsService = connectionsService;
     _notificationQuery  = notificationQuery;
 }
Exemple #26
0
 public Synchronize(AppSettings appSettings, IQuery query, ISelectorStorage selectorStorage, IWebLogger logger, IMemoryCache memoryCache = null)
 {
     _console         = new ConsoleWrapper();
     _subPathStorage  = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _syncSingleFile  = new SyncSingleFile(appSettings, query, _subPathStorage, logger);
     _syncRemove      = new SyncRemove(appSettings, query, memoryCache, logger);
     _syncFolder      = new SyncFolder(appSettings, query, selectorStorage, _console, logger, memoryCache);
     _syncIgnoreCheck = new SyncIgnoreCheck(appSettings, _console);
 }
Exemple #27
0
 public WebFtpCli(AppSettings appSettings, ISelectorStorage selectorStorage, IConsole console,
                  IFtpWebRequestFactory webRequestFactory)
 {
     _appSettings         = appSettings;
     _console             = console;
     _argsHelper          = new ArgsHelper(_appSettings, console);
     _hostStorageProvider = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
     _webRequestFactory   = webRequestFactory;
 }
Exemple #28
0
 public WebHtmlPublishService(IPublishPreflight publishPreflight, ISelectorStorage
                              selectorStorage, AppSettings appSettings, IExifToolHostStorage exifTool,
                              IOverlayImage overlayImage, IConsole console, IWebLogger logger)
 {
     _publishPreflight      = publishPreflight;
     _subPathStorage        = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _thumbnailStorage      = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail);
     _hostFileSystemStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem);
     _appSettings           = appSettings;
     _exifTool             = exifTool;
     _console              = console;
     _overlayImage         = overlayImage;
     _publishManifest      = new PublishManifest(_hostFileSystemStorage, new PlainTextFileHelper());
     _toCreateSubfolder    = new ToCreateSubfolder(_hostFileSystemStorage);
     _copyPublishedContent = new CopyPublishedContent(_appSettings, _toCreateSubfolder,
                                                      selectorStorage);
     _logger           = logger;
     _thumbnailService = new Thumbnail(_subPathStorage, _thumbnailStorage, _logger);
 }
Exemple #29
0
 public GeoController(IUpdateBackgroundTaskQueue queue,
                      ISelectorStorage selectorStorage,
                      IMemoryCache memoryCache, IWebLogger logger, IServiceScopeFactory serviceScopeFactory)
 {
     _bgTaskQueue         = queue;
     _iStorage            = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     _cache               = memoryCache;
     _serviceScopeFactory = serviceScopeFactory;
     _logger              = logger;
 }
Exemple #30
0
 /// <summary>Replace meta content</summary>
 /// <param name="query">Starsky IQuery interface to do calls on the database</param>
 /// <param name="appSettings">Settings of the application</param>
 /// <param name="selectorStorage">storage abstraction</param>
 /// <param name="logger">web logger</param>
 public MetaReplaceService(IQuery query, AppSettings appSettings, ISelectorStorage selectorStorage, IWebLogger logger)
 {
     _query       = query;
     _appSettings = appSettings;
     if (selectorStorage != null)
     {
         _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath);
     }
     _logger = logger;
 }