mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Refactor.
This commit is contained in:
@@ -41,7 +41,7 @@ namespace DiscImageChef.Server.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private IWebHostEnvironment _environment;
|
||||
private readonly IWebHostEnvironment _environment;
|
||||
|
||||
public HomeController(IWebHostEnvironment environment)
|
||||
{
|
||||
@@ -52,10 +52,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
[Route("README")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
StreamReader sr =
|
||||
var sr =
|
||||
new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(),
|
||||
"docs", "README.md"));
|
||||
string mdcontent = sr.ReadToEnd();
|
||||
"docs", "README.md"));
|
||||
var mdcontent = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
|
||||
mdcontent = mdcontent.Replace(".md)", ")");
|
||||
@@ -70,10 +70,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
[Route("Changelog")]
|
||||
public ActionResult Changelog()
|
||||
{
|
||||
StreamReader sr =
|
||||
var sr =
|
||||
new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(),
|
||||
"docs", "Changelog.md"));
|
||||
string mdcontent = sr.ReadToEnd();
|
||||
"docs", "Changelog.md"));
|
||||
var mdcontent = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
|
||||
mdcontent = mdcontent.Replace(".md)", ")");
|
||||
@@ -88,10 +88,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
[Route("CODE_OF_CONDUCT")]
|
||||
public ActionResult CODE_OF_CONDUCT()
|
||||
{
|
||||
StreamReader sr =
|
||||
var sr =
|
||||
new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(),
|
||||
"docs", "CODE_OF_CONDUCT.md"));
|
||||
string mdcontent = sr.ReadToEnd();
|
||||
"docs", "CODE_OF_CONDUCT.md"));
|
||||
var mdcontent = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
|
||||
mdcontent = mdcontent.Replace(".md)", ")").Replace("(.github/", "(");
|
||||
@@ -106,10 +106,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
[Route("PULL_REQUEST_TEMPLATE")]
|
||||
public ActionResult PULL_REQUEST_TEMPLATE()
|
||||
{
|
||||
StreamReader sr =
|
||||
var sr =
|
||||
new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(),
|
||||
"docs", "PULL_REQUEST_TEMPLATE.md"));
|
||||
string mdcontent = sr.ReadToEnd();
|
||||
"docs", "PULL_REQUEST_TEMPLATE.md"));
|
||||
var mdcontent = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
|
||||
mdcontent = mdcontent.Replace(".md)", ")").Replace("(.github/", "(");
|
||||
@@ -124,10 +124,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
[Route("ISSUE_TEMPLATE")]
|
||||
public ActionResult ISSUE_TEMPLATE()
|
||||
{
|
||||
StreamReader sr =
|
||||
var sr =
|
||||
new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(),
|
||||
"docs", "ISSUE_TEMPLATE.md"));
|
||||
string mdcontent = sr.ReadToEnd();
|
||||
"docs", "ISSUE_TEMPLATE.md"));
|
||||
var mdcontent = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
|
||||
mdcontent = mdcontent.Replace(".md)", ")").Replace("(.github/", "(");
|
||||
@@ -142,10 +142,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
[Route("CONTRIBUTING")]
|
||||
public ActionResult CONTRIBUTING()
|
||||
{
|
||||
StreamReader sr =
|
||||
var sr =
|
||||
new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(),
|
||||
"docs", "CONTRIBUTING.md"));
|
||||
string mdcontent = sr.ReadToEnd();
|
||||
"docs", "CONTRIBUTING.md"));
|
||||
var mdcontent = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
|
||||
mdcontent = mdcontent.Replace(".md)", ")").Replace("(.github/", "(");
|
||||
@@ -160,10 +160,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
[Route("DONATING")]
|
||||
public ActionResult DONATING()
|
||||
{
|
||||
StreamReader sr =
|
||||
var sr =
|
||||
new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(),
|
||||
"docs", "DONATING.md"));
|
||||
string mdcontent = sr.ReadToEnd();
|
||||
"docs", "DONATING.md"));
|
||||
var mdcontent = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
|
||||
mdcontent = mdcontent.Replace(".md)", ")");
|
||||
@@ -178,10 +178,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
[Route("TODO")]
|
||||
public ActionResult TODO()
|
||||
{
|
||||
StreamReader sr =
|
||||
var sr =
|
||||
new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(),
|
||||
"docs", "TODO.md"));
|
||||
string mdcontent = sr.ReadToEnd();
|
||||
"docs", "TODO.md"));
|
||||
var mdcontent = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
|
||||
mdcontent = mdcontent.Replace(".md)", ")");
|
||||
|
||||
Reference in New Issue
Block a user