mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Reformat and apply Stylecop rules
This commit is contained in:
@@ -30,8 +30,8 @@ namespace Radarr.Api.V3.System.Backup
|
||||
GetResourceAll = GetBackupFiles;
|
||||
DeleteResource = DeleteBackup;
|
||||
|
||||
Post(@"/restore/(?<id>[\d]{1,10})", x => Restore((int)x.Id));
|
||||
Post("/restore/upload", x => UploadAndRestore());
|
||||
Post(@"/restore/(?<id>[\d]{1,10})", x => Restore((int)x.Id));
|
||||
Post("/restore/upload", x => UploadAndRestore());
|
||||
}
|
||||
|
||||
public List<BackupResource> GetBackupFiles()
|
||||
@@ -39,13 +39,13 @@ namespace Radarr.Api.V3.System.Backup
|
||||
var backups = _backupService.GetBackups();
|
||||
|
||||
return backups.Select(b => new BackupResource
|
||||
{
|
||||
Id = GetBackupId(b),
|
||||
Name = b.Name,
|
||||
Path = $"/backup/{b.Type.ToString().ToLower()}/{b.Name}",
|
||||
Type = b.Type,
|
||||
Time = b.Time
|
||||
})
|
||||
{
|
||||
Id = GetBackupId(b),
|
||||
Name = b.Name,
|
||||
Path = $"/backup/{b.Type.ToString().ToLower()}/{b.Name}",
|
||||
Type = b.Type,
|
||||
Time = b.Time
|
||||
})
|
||||
.OrderByDescending(b => b.Time)
|
||||
.ToList();
|
||||
}
|
||||
@@ -77,9 +77,9 @@ namespace Radarr.Api.V3.System.Backup
|
||||
_backupService.Restore(path);
|
||||
|
||||
return new
|
||||
{
|
||||
RestartRequired = true
|
||||
};
|
||||
{
|
||||
RestartRequired = true
|
||||
};
|
||||
}
|
||||
|
||||
public object UploadAndRestore()
|
||||
@@ -108,9 +108,9 @@ namespace Radarr.Api.V3.System.Backup
|
||||
_diskProvider.DeleteFile(path);
|
||||
|
||||
return new
|
||||
{
|
||||
RestartRequired = true
|
||||
};
|
||||
{
|
||||
RestartRequired = true
|
||||
};
|
||||
}
|
||||
|
||||
private string GetBackupPath(NzbDrone.Core.Backup.Backup backup)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Radarr.Http.REST;
|
||||
using NzbDrone.Core.Backup;
|
||||
using Radarr.Http.REST;
|
||||
|
||||
namespace Radarr.Api.V3.System.Backup
|
||||
{
|
||||
|
||||
@@ -37,42 +37,42 @@ namespace Radarr.Api.V3.System
|
||||
_configFileProvider = configFileProvider;
|
||||
_database = database;
|
||||
_lifecycleService = lifecycleService;
|
||||
Get("/status", x => GetStatus());
|
||||
Get("/routes", x => GetRoutes());
|
||||
Post("/shutdown", x => Shutdown());
|
||||
Post("/restart", x => Restart());
|
||||
Get("/status", x => GetStatus());
|
||||
Get("/routes", x => GetRoutes());
|
||||
Post("/shutdown", x => Shutdown());
|
||||
Post("/restart", x => Restart());
|
||||
}
|
||||
|
||||
private object GetStatus()
|
||||
{
|
||||
return new
|
||||
{
|
||||
Version = BuildInfo.Version.ToString(),
|
||||
BuildTime = BuildInfo.BuildDateTime,
|
||||
IsDebug = BuildInfo.IsDebug,
|
||||
IsProduction = RuntimeInfo.IsProduction,
|
||||
IsAdmin = _runtimeInfo.IsAdmin,
|
||||
IsUserInteractive = RuntimeInfo.IsUserInteractive,
|
||||
StartupPath = _appFolderInfo.StartUpFolder,
|
||||
AppData = _appFolderInfo.GetAppDataPath(),
|
||||
OsName = _osInfo.Name,
|
||||
OsVersion = _osInfo.Version,
|
||||
IsNetCore = PlatformInfo.IsNetCore,
|
||||
IsMono = PlatformInfo.IsMono,
|
||||
IsLinux = OsInfo.IsLinux,
|
||||
IsOsx = OsInfo.IsOsx,
|
||||
IsWindows = OsInfo.IsWindows,
|
||||
IsDocker = _osInfo.IsDocker,
|
||||
Mode = _runtimeInfo.Mode,
|
||||
Branch = _configFileProvider.Branch,
|
||||
Authentication = _configFileProvider.AuthenticationMethod,
|
||||
SqliteVersion = _database.Version,
|
||||
MigrationVersion = _database.Migration,
|
||||
UrlBase = _configFileProvider.UrlBase,
|
||||
RuntimeVersion = _platformInfo.Version,
|
||||
RuntimeName = PlatformInfo.Platform,
|
||||
StartTime = _runtimeInfo.StartTime
|
||||
};
|
||||
{
|
||||
Version = BuildInfo.Version.ToString(),
|
||||
BuildTime = BuildInfo.BuildDateTime,
|
||||
IsDebug = BuildInfo.IsDebug,
|
||||
IsProduction = RuntimeInfo.IsProduction,
|
||||
IsAdmin = _runtimeInfo.IsAdmin,
|
||||
IsUserInteractive = RuntimeInfo.IsUserInteractive,
|
||||
StartupPath = _appFolderInfo.StartUpFolder,
|
||||
AppData = _appFolderInfo.GetAppDataPath(),
|
||||
OsName = _osInfo.Name,
|
||||
OsVersion = _osInfo.Version,
|
||||
IsNetCore = PlatformInfo.IsNetCore,
|
||||
IsMono = PlatformInfo.IsMono,
|
||||
IsLinux = OsInfo.IsLinux,
|
||||
IsOsx = OsInfo.IsOsx,
|
||||
IsWindows = OsInfo.IsWindows,
|
||||
IsDocker = _osInfo.IsDocker,
|
||||
Mode = _runtimeInfo.Mode,
|
||||
Branch = _configFileProvider.Branch,
|
||||
Authentication = _configFileProvider.AuthenticationMethod,
|
||||
SqliteVersion = _database.Version,
|
||||
MigrationVersion = _database.Migration,
|
||||
UrlBase = _configFileProvider.UrlBase,
|
||||
RuntimeVersion = _platformInfo.Version,
|
||||
RuntimeName = PlatformInfo.Platform,
|
||||
StartTime = _runtimeInfo.StartTime
|
||||
};
|
||||
}
|
||||
|
||||
private object GetRoutes()
|
||||
|
||||
@@ -47,15 +47,15 @@ namespace Radarr.Api.V3.System.Tasks
|
||||
var taskName = scheduledTask.TypeName.Split('.').Last().Replace("Command", "");
|
||||
|
||||
return new TaskResource
|
||||
{
|
||||
Id = scheduledTask.Id,
|
||||
Name = taskName.SplitCamelCase(),
|
||||
TaskName = taskName,
|
||||
Interval = scheduledTask.Interval,
|
||||
LastExecution = scheduledTask.LastExecution,
|
||||
LastStartTime = scheduledTask.LastStartTime,
|
||||
NextExecution = scheduledTask.LastExecution.AddMinutes(scheduledTask.Interval)
|
||||
};
|
||||
{
|
||||
Id = scheduledTask.Id,
|
||||
Name = taskName.SplitCamelCase(),
|
||||
TaskName = taskName,
|
||||
Interval = scheduledTask.Interval,
|
||||
LastExecution = scheduledTask.LastExecution,
|
||||
LastStartTime = scheduledTask.LastStartTime,
|
||||
NextExecution = scheduledTask.LastExecution.AddMinutes(scheduledTask.Interval)
|
||||
};
|
||||
}
|
||||
|
||||
public void Handle(CommandExecutedEvent message)
|
||||
|
||||
Reference in New Issue
Block a user