Exemple #1
0
        public MediaCoverModule(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider) : base("MediaCover")
        {
            _appFolderInfo = appFolderInfo;
            _diskProvider = diskProvider;

            Get[MEDIA_COVER_ROUTE] = options => GetMediaCover(options.seriesId, options.filename);
        }
Exemple #2
0
 public UpdateLogFileModule(IAppFolderInfo appFolderInfo,
                            IDiskProvider diskProvider,
                            IConfigFileProvider configFileProvider)
     : base(diskProvider, configFileProvider, "/update")
 {
     _appFolderInfo = appFolderInfo;
     _diskProvider = diskProvider;
 }
Exemple #3
0
 public BackupAppData(IAppFolderInfo appFolderInfo,
                      IDiskProvider diskProvider,
                      IDiskTransferService diskTransferService,
                      Logger logger)
 {
     _appFolderInfo = appFolderInfo;
     _diskProvider = diskProvider;
     _diskTransferService = diskTransferService;
     _logger = logger;
 }
Exemple #4
0
 public SystemModule(IAppFolderInfo appFolderInfo, IRuntimeInfo runtimeInfo, IRouteCacheProvider routeCacheProvider, IConfigFileProvider configFileProvider)
     : base("system")
 {
     _appFolderInfo = appFolderInfo;
     _runtimeInfo = runtimeInfo;
     _routeCacheProvider = routeCacheProvider;
     _configFileProvider = configFileProvider;
     Get["/status"] = x => GetStatus();
     Get["/routes"] = x => GetRoutes();
 }
 public IndexHtmlMapper(IAppFolderInfo appFolderInfo,
                        IDiskProvider diskProvider,
                        IConfigFileProvider configFileProvider,
                        Logger logger)
     : base(diskProvider, logger)
 {
     _diskProvider = diskProvider;
     _configFileProvider = configFileProvider;
     _indexPath = Path.Combine(appFolderInfo.StartUpFolder, "UI", "index.html");
 }
Exemple #6
0
 public UpdateCheck(IDiskProvider diskProvider,
                    IAppFolderInfo appFolderInfo,
                    ICheckUpdateService checkUpdateService,
                    IConfigFileProvider configFileProvider)
 {
     _diskProvider = diskProvider;
     _appFolderInfo = appFolderInfo;
     _checkUpdateService = checkUpdateService;
     _configFileProvider = configFileProvider;
 }
 public InstallUpdateService(IDiskProvider diskProvider, IDetectApplicationType detectApplicationType, ITerminateNzbDrone terminateNzbDrone,
     IAppFolderInfo appFolderInfo, IBackupAndRestore backupAndRestore, IStartNzbDrone startNzbDrone, Logger logger)
 {
     _diskProvider = diskProvider;
     _detectApplicationType = detectApplicationType;
     _terminateNzbDrone = terminateNzbDrone;
     _appFolderInfo = appFolderInfo;
     _backupAndRestore = backupAndRestore;
     _startNzbDrone = startNzbDrone;
     _logger = logger;
 }
        public IndexHtmlMapper(IAppFolderInfo appFolderInfo,
                               IDiskProvider diskProvider,
                               IConfigFileProvider configFileProvider,
                               Logger logger)
            : base(diskProvider, logger)
        {
            _diskProvider = diskProvider;
            _indexPath = Path.Combine(appFolderInfo.StartUpFolder, "UI", "index.html");

            API_KEY = configFileProvider.ApiKey;
            URL_BASE = configFileProvider.UrlBase;
        }
Exemple #9
0
        public LoginHtmlMapper(IAppFolderInfo appFolderInfo,
                               IDiskProvider diskProvider,
                               IConfigFileProvider configFileProvider,
                               Func<ICacheBreakerProvider> cacheBreakProviderFactory,
                               Logger logger)
            : base(diskProvider, logger)
        {
            _diskProvider = diskProvider;
            _cacheBreakProviderFactory = cacheBreakProviderFactory;
            _indexPath = Path.Combine(appFolderInfo.StartUpFolder, "UI", "login.html");

            URL_BASE = configFileProvider.UrlBase;
        }
Exemple #10
0
        public IndexHtmlMapper(IAppFolderInfo appFolderInfo,
                               IDiskProvider diskProvider,
                               IConfigFileProvider configFileProvider,
                               IAnalyticsService analyticsService,
                               Func<ICacheBreakerProvider> cacheBreakProviderFactory,
                               Logger logger)
            : base(diskProvider, logger)
        {
            _diskProvider = diskProvider;
            _configFileProvider = configFileProvider;
            _analyticsService = analyticsService;
            _cacheBreakProviderFactory = cacheBreakProviderFactory;
            _indexPath = Path.Combine(appFolderInfo.StartUpFolder, "UI", "index.html");

            API_KEY = configFileProvider.ApiKey;
            URL_BASE = configFileProvider.UrlBase;
        }
Exemple #11
0
 public SystemModule(IAppFolderInfo appFolderInfo,
                     IRuntimeInfo runtimeInfo,
                     IRouteCacheProvider routeCacheProvider,
                     IConfigFileProvider configFileProvider,
                     IMainDatabase database,
                     ILifecycleService lifecycleService)
     : base("system")
 {
     _appFolderInfo = appFolderInfo;
     _runtimeInfo = runtimeInfo;
     _routeCacheProvider = routeCacheProvider;
     _configFileProvider = configFileProvider;
     _database = database;
     _lifecycleService = lifecycleService;
     Get["/status"] = x => GetStatus();
     Get["/routes"] = x => GetRoutes();
     Post["/shutdown"] = x => Shutdown();
     Post["/restart"] = x => Restart();
 }
Exemple #12
0
        private static void RegisterAppFile(IAppFolderInfo appFolderInfo)
        {
            var fileTarget = new FileTarget();

            fileTarget.Name = "rollingFileLogger";
            fileTarget.FileName = Path.Combine(appFolderInfo.GetLogFolder(), "nzbdrone.txt");
            fileTarget.AutoFlush = true;
            fileTarget.KeepFileOpen = false;
            fileTarget.ConcurrentWrites = false;
            fileTarget.ConcurrentWriteAttemptDelay = 50;
            fileTarget.ConcurrentWriteAttempts = 10;
            fileTarget.ArchiveAboveSize = 1024000;
            fileTarget.MaxArchiveFiles = 5;
            fileTarget.EnableFileDelete = true;
            fileTarget.ArchiveNumbering = ArchiveNumberingMode.Rolling;
            fileTarget.Layout = FILE_LOG_LAYOUT;

            var loggingRule = new LoggingRule("*", LogLevel.Info, fileTarget);

            LogManager.Configuration.AddTarget("appfile", fileTarget);
            LogManager.Configuration.LoggingRules.Add(loggingRule);
        }
 public InstallUpdateService(IDiskProvider diskProvider,
                             IDiskTransferService diskTransferService,
                             IDetectApplicationType detectApplicationType,
                             IDetectExistingVersion detectExistingVersion,
                             ITerminateNzbDrone terminateNzbDrone,
                             IAppFolderInfo appFolderInfo,
                             IBackupAndRestore backupAndRestore,
                             IBackupAppData backupAppData,
                             IStartNzbDrone startNzbDrone,
                             IProcessProvider processProvider,
                             Logger logger)
 {
     _diskProvider = diskProvider;
     _diskTransferService = diskTransferService;
     _detectApplicationType = detectApplicationType;
     _detectExistingVersion = detectExistingVersion;
     _terminateNzbDrone = terminateNzbDrone;
     _appFolderInfo = appFolderInfo;
     _backupAndRestore = backupAndRestore;
     _backupAppData = backupAppData;
     _startNzbDrone = startNzbDrone;
     _processProvider = processProvider;
     _logger = logger;
 }
 public BackupAndRestore(IDiskProvider diskProvider, IAppFolderInfo appFolderInfo, Logger logger)
 {
     _diskProvider = diskProvider;
     _appFolderInfo = appFolderInfo;
     _logger = logger;
 }
 public StartupFolderValidator(IAppFolderInfo appFolderInfo)
     : base("Path cannot be an ancestor of the start up folder")
 {
     _appFolderInfo = appFolderInfo;
 }
Exemple #16
0
 public static string GetNlogConfigPath(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(appFolderInfo.StartUpFolder, NLOG_CONFIG_FILE));
 }
Exemple #17
0
        private static void RegisterUpdateFile(IAppFolderInfo appFolderInfo)
        {
            var fileTarget = new FileTarget();

            fileTarget.Name = "updateFileLogger";
            fileTarget.FileName = Path.Combine(appFolderInfo.GetUpdateLogFolder(), DateTime.Now.ToString("yy.MM.d-HH.mm") + ".txt");
            fileTarget.AutoFlush = true;
            fileTarget.KeepFileOpen = false;
            fileTarget.ConcurrentWrites = false;
            fileTarget.ConcurrentWriteAttemptDelay = 50;
            fileTarget.ConcurrentWriteAttempts = 100;
            fileTarget.Layout = FILE_LOG_LAYOUT;

            var loggingRule = new LoggingRule("*", LogLevel.Trace, fileTarget);

            LogManager.Configuration.AddTarget("updateFile", fileTarget);
            LogManager.Configuration.LoggingRules.Add(loggingRule);
        }
 private static void RegisterAppFile(IAppFolderInfo appFolderInfo)
 {
     RegisterAppFile(appFolderInfo, "appFileInfo", "sonarr.txt", 5, LogLevel.Info);
     RegisterAppFile(appFolderInfo, "appFileDebug", "sonarr.debug.txt", 50, LogLevel.Off);
     RegisterAppFile(appFolderInfo, "appFileTrace", "sonarr.trace.txt", 50, LogLevel.Off);
 }
Exemple #19
0
 public RobotsTxtMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo = appFolderInfo;
 }
Exemple #20
0
 public BackupAppData(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
 {
     _appFolderInfo = appFolderInfo;
     _diskProvider  = diskProvider;
     _logger        = logger;
 }
Exemple #21
0
 public UpdateLogFileMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo = appFolderInfo;
 }
 public ConnectionStringFactory(IAppFolderInfo appFolderInfo)
 {
     MainDbConnectionString = GetConnectionString(appFolderInfo.GetNzbDroneDatabase());
     LogDbConnectionString  = GetConnectionString(appFolderInfo.GetLogDatabase());
 }
Exemple #23
0
 public PidFileProvider(IAppFolderInfo appFolderInfo, IProcessProvider processProvider, Logger logger)
 {
     _appFolderInfo   = appFolderInfo;
     _processProvider = processProvider;
     _logger          = logger;
 }
Exemple #24
0
 public AppDataLocationCheck(IAppFolderInfo appFolderInfo)
 {
     _appFolderInfo = appFolderInfo;
 }
 public DeleteLogFilesService(IDiskProvider diskProvider, IAppFolderInfo appFolderInfo, Logger logger)
 {
     _diskProvider  = diskProvider;
     _appFolderInfo = appFolderInfo;
     _logger        = logger;
 }
Exemple #26
0
 public RobotsTxtMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, IConfigFileProvider configFileProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo      = appFolderInfo;
     _configFileProvider = configFileProvider;
 }
 public StaticResourceMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, IConfigFileProvider configFileProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo      = appFolderInfo;
     _configFileProvider = configFileProvider;
 }
Exemple #28
0
 public BackupAppData(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
 {
     _appFolderInfo = appFolderInfo;
     _diskProvider = diskProvider;
     _logger = logger;
 }
Exemple #29
0
 public static string GetUpdateClientExePath(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetUpdateSandboxFolder(appFolderInfo), UPDATE_CLIENT_EXE));
 }
Exemple #30
0
 public static string GetAppDataPath(this IAppFolderInfo appFolderInfo)
 {
     return(appFolderInfo.AppDataFolder);
 }
Exemple #31
0
 public static string GetLogFolder(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetAppDataPath(appFolderInfo), "logs"));
 }
Exemple #32
0
 public static string GetBackupFolder(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetAppDataPath(appFolderInfo), BACKUP_FOLDER));
 }
Exemple #33
0
 private static void RegisterAppFile(IAppFolderInfo appFolderInfo)
 {
     RegisterAppFile(appFolderInfo, "appFileInfo", "radarr.txt", 5, LogLevel.Info);
     RegisterAppFile(appFolderInfo, "appFileDebug", "radarr.debug.txt", 50, LogLevel.Off);
     RegisterAppFile(appFolderInfo, "appFileTrace", "radarr.trace.txt", 50, LogLevel.Off);
 }
Exemple #34
0
 public static string GetConfigBackupFile(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetAppDataPath(appFolderInfo), BACKUP_ZIP_FILE));
 }
        private static LoggingRule RegisterAppFile(IAppFolderInfo appFolderInfo, string name, string fileName, int maxArchiveFiles, LogLevel minLogLevel)
        {
            var fileTarget = new NzbDroneFileTarget();

            fileTarget.Name = name;
            fileTarget.FileName = Path.Combine(appFolderInfo.GetLogFolder(), fileName);
            fileTarget.AutoFlush = true;
            fileTarget.KeepFileOpen = false;
            fileTarget.ConcurrentWrites = false;
            fileTarget.ConcurrentWriteAttemptDelay = 50;
            fileTarget.ConcurrentWriteAttempts = 10;
            fileTarget.ArchiveAboveSize = 1024000;
            fileTarget.MaxArchiveFiles = maxArchiveFiles;
            fileTarget.EnableFileDelete = true;
            fileTarget.ArchiveNumbering = ArchiveNumberingMode.Rolling;
            fileTarget.Layout = FILE_LOG_LAYOUT;

            var loggingRule = new LoggingRule("*", minLogLevel, fileTarget);

            LogManager.Configuration.AddTarget(name, fileTarget);
            LogManager.Configuration.LoggingRules.Add(loggingRule);

            return loggingRule;
        }
 public StaticResourceMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo = appFolderInfo;
 }
Exemple #37
0
 public static string GetConfigPath(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetAppDataPath(appFolderInfo), APP_CONFIG_FILE));
 }
Exemple #38
0
 public static string GetLogDatabase(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetAppDataPath(appFolderInfo), NZBDRONE_LOG_DB));
 }
Exemple #39
0
 public FaviconMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo = appFolderInfo;
 }
Exemple #40
0
 public static string GetMediaCoverPath(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetAppDataPath(appFolderInfo), "MediaCover"));
 }
 public AppDataLocationCheck(IAppFolderInfo appFolderInfo)
 {
     _appFolderInfo = appFolderInfo;
 }
Exemple #42
0
 public static string GetUpdateLogFolder(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetAppDataPath(appFolderInfo), UPDATE_LOG_FOLDER_NAME));
 }
 public StaticResourceMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, IConfigFileProvider configFileProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo = appFolderInfo;
     _configFileProvider = configFileProvider;
 }
Exemple #44
0
 public static string GetUpdatePackageFolder(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetUpdateSandboxFolder(appFolderInfo), UPDATE_PACKAGE_FOLDER_NAME));
 }
 public StartupFolderValidator(IAppFolderInfo appFolderInfo)
     : base("Path cannot be an ancestor of the start up folder")
 {
     _appFolderInfo = appFolderInfo;
 }
Exemple #46
0
 public MediaCoverMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo = appFolderInfo;
     _diskProvider  = diskProvider;
 }
Exemple #47
0
 public MediaCoverMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo = appFolderInfo;
     _diskProvider = diskProvider;
 }
Exemple #48
0
 public static string GetDatabaseRestore(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetAppDataPath(appFolderInfo), DB_RESTORE));
 }
Exemple #49
0
 public UpdateCheck(IDiskProvider diskProvider, IAppFolderInfo appFolderInfo, ICheckUpdateService checkUpdateService)
 {
     _diskProvider = diskProvider;
     _appFolderInfo = appFolderInfo;
     _checkUpdateService = checkUpdateService;
 }
Exemple #50
0
 public static string GetUpdateClientFolder(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetUpdatePackageFolder(appFolderInfo), UPDATE_CLIENT_FOLDER_NAME));
 }
Exemple #51
0
 public static string GetUpdateSandboxFolder(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(appFolderInfo.TempFolder, UPDATE_SANDBOX_FOLDER_NAME));
 }
 public BackupAndRestore(IDiskProvider diskProvider, IAppFolderInfo appFolderInfo, Logger logger)
 {
     _diskProvider  = diskProvider;
     _appFolderInfo = appFolderInfo;
     _logger        = logger;
 }
Exemple #53
0
 public BackupFileMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo = appFolderInfo;
 }
Exemple #54
0
 public static string GetUpdateBackUpAppDataFolder(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetUpdateSandboxFolder(appFolderInfo), UPDATE_BACKUP_APPDATA_FOLDER_NAME));
 }
Exemple #55
0
 public PidFileProvider(IAppFolderInfo appFolderInfo, IProcessProvider processProvider, Logger logger)
 {
     _appFolderInfo = appFolderInfo;
     _processProvider = processProvider;
     _logger = logger;
 }
Exemple #56
0
 public static string GetUpdateBackupConfigFile(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetUpdateBackUpAppDataFolder(appFolderInfo), APP_CONFIG_FILE));
 }
Exemple #57
0
 public AppFolderFactory(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider)
 {
     _appFolderInfo = appFolderInfo;
     _diskProvider = diskProvider;
     _logger = NzbDroneLogger.GetLogger(this);
 }
Exemple #58
0
 public static string GetUpdateBackupDatabase(this IAppFolderInfo appFolderInfo)
 {
     return(Path.Combine(GetUpdateBackUpAppDataFolder(appFolderInfo), DB));
 }
 public ConnectionStringFactory(IAppFolderInfo appFolderInfo)
 {
     MainDbConnectionString = GetConnectionString(appFolderInfo.GetNzbDroneDatabase());
     LogDbConnectionString = GetConnectionString(appFolderInfo.GetLogDatabase());
 }
 public StaticResourceMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _appFolderInfo = appFolderInfo;
 }