mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Fix variable naming.
This commit is contained in:
@@ -52,13 +52,13 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
{
|
{
|
||||||
public class UploadReportController : Controller
|
public class UploadReportController : Controller
|
||||||
{
|
{
|
||||||
|
readonly DicServerContext _ctx;
|
||||||
readonly IWebHostEnvironment _environment;
|
readonly IWebHostEnvironment _environment;
|
||||||
readonly DicServerContext ctx;
|
|
||||||
|
|
||||||
public UploadReportController(IWebHostEnvironment environment, DicServerContext _ctx)
|
public UploadReportController(IWebHostEnvironment environment, DicServerContext ctx)
|
||||||
{
|
{
|
||||||
_environment = environment;
|
_environment = environment;
|
||||||
ctx = _ctx;
|
_ctx = ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Receives a report from DiscImageChef.Core, verifies it's in the correct format and stores it on the server</summary>
|
/// <summary>Receives a report from DiscImageChef.Core, verifies it's in the correct format and stores it on the server</summary>
|
||||||
@@ -121,7 +121,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
if(newUploadedReport.ATA?.ReadCapabilities?.CHS != null)
|
if(newUploadedReport.ATA?.ReadCapabilities?.CHS != null)
|
||||||
{
|
{
|
||||||
Chs existingChs =
|
Chs existingChs =
|
||||||
ctx.Chs.FirstOrDefault(c =>
|
_ctx.Chs.FirstOrDefault(c =>
|
||||||
c.Cylinders == newUploadedReport.
|
c.Cylinders == newUploadedReport.
|
||||||
ATA.ReadCapabilities.CHS.Cylinders &&
|
ATA.ReadCapabilities.CHS.Cylinders &&
|
||||||
c.Heads == newUploadedReport.ATA.ReadCapabilities.CHS.Heads &&
|
c.Heads == newUploadedReport.ATA.ReadCapabilities.CHS.Heads &&
|
||||||
@@ -134,10 +134,11 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
if(newUploadedReport.ATA?.ReadCapabilities?.CurrentCHS != null)
|
if(newUploadedReport.ATA?.ReadCapabilities?.CurrentCHS != null)
|
||||||
{
|
{
|
||||||
Chs existingChs =
|
Chs existingChs =
|
||||||
ctx.Chs.FirstOrDefault(c =>
|
_ctx.Chs.FirstOrDefault(c =>
|
||||||
c.Cylinders == newUploadedReport.
|
c.Cylinders == newUploadedReport.
|
||||||
ATA.ReadCapabilities.CurrentCHS.Cylinders &&
|
ATA.ReadCapabilities.CurrentCHS.Cylinders &&
|
||||||
c.Heads == newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Heads &&
|
c.Heads == newUploadedReport.
|
||||||
|
ATA.ReadCapabilities.CurrentCHS.Heads &&
|
||||||
c.Sectors == newUploadedReport.
|
c.Sectors == newUploadedReport.
|
||||||
ATA.ReadCapabilities.CurrentCHS.Sectors);
|
ATA.ReadCapabilities.CurrentCHS.Sectors);
|
||||||
|
|
||||||
@@ -163,7 +164,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
if(media.CHS != null)
|
if(media.CHS != null)
|
||||||
{
|
{
|
||||||
Chs existingChs =
|
Chs existingChs =
|
||||||
ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CHS.Cylinders &&
|
_ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CHS.Cylinders &&
|
||||||
c.Heads == media.CHS.Heads &&
|
c.Heads == media.CHS.Heads &&
|
||||||
c.Sectors == media.CHS.Sectors);
|
c.Sectors == media.CHS.Sectors);
|
||||||
|
|
||||||
@@ -174,7 +175,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
if(media.CHS != null)
|
if(media.CHS != null)
|
||||||
{
|
{
|
||||||
Chs existingChs =
|
Chs existingChs =
|
||||||
ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CurrentCHS.Cylinders &&
|
_ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CurrentCHS.Cylinders &&
|
||||||
c.Heads == media.CurrentCHS.Heads &&
|
c.Heads == media.CurrentCHS.Heads &&
|
||||||
c.Sectors == media.CurrentCHS.Sectors);
|
c.Sectors == media.CurrentCHS.Sectors);
|
||||||
|
|
||||||
@@ -184,8 +185,8 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Reports.Add(newUploadedReport);
|
_ctx.Reports.Add(newUploadedReport);
|
||||||
ctx.SaveChanges();
|
_ctx.SaveChanges();
|
||||||
|
|
||||||
var pgpIn = new MemoryStream(Encoding.UTF8.GetBytes(reportV2String));
|
var pgpIn = new MemoryStream(Encoding.UTF8.GetBytes(reportV2String));
|
||||||
var pgpOut = new MemoryStream();
|
var pgpOut = new MemoryStream();
|
||||||
@@ -280,7 +281,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
if(newUploadedReport.ATA?.ReadCapabilities?.CHS != null)
|
if(newUploadedReport.ATA?.ReadCapabilities?.CHS != null)
|
||||||
{
|
{
|
||||||
Chs existingChs =
|
Chs existingChs =
|
||||||
ctx.Chs.FirstOrDefault(c =>
|
_ctx.Chs.FirstOrDefault(c =>
|
||||||
c.Cylinders == newUploadedReport.
|
c.Cylinders == newUploadedReport.
|
||||||
ATA.ReadCapabilities.CHS.Cylinders &&
|
ATA.ReadCapabilities.CHS.Cylinders &&
|
||||||
c.Heads == newUploadedReport.ATA.ReadCapabilities.CHS.Heads &&
|
c.Heads == newUploadedReport.ATA.ReadCapabilities.CHS.Heads &&
|
||||||
@@ -293,10 +294,11 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
if(newUploadedReport.ATA?.ReadCapabilities?.CurrentCHS != null)
|
if(newUploadedReport.ATA?.ReadCapabilities?.CurrentCHS != null)
|
||||||
{
|
{
|
||||||
Chs existingChs =
|
Chs existingChs =
|
||||||
ctx.Chs.FirstOrDefault(c =>
|
_ctx.Chs.FirstOrDefault(c =>
|
||||||
c.Cylinders == newUploadedReport.
|
c.Cylinders == newUploadedReport.
|
||||||
ATA.ReadCapabilities.CurrentCHS.Cylinders &&
|
ATA.ReadCapabilities.CurrentCHS.Cylinders &&
|
||||||
c.Heads == newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Heads &&
|
c.Heads == newUploadedReport.
|
||||||
|
ATA.ReadCapabilities.CurrentCHS.Heads &&
|
||||||
c.Sectors == newUploadedReport.
|
c.Sectors == newUploadedReport.
|
||||||
ATA.ReadCapabilities.CurrentCHS.Sectors);
|
ATA.ReadCapabilities.CurrentCHS.Sectors);
|
||||||
|
|
||||||
@@ -322,7 +324,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
if(media.CHS != null)
|
if(media.CHS != null)
|
||||||
{
|
{
|
||||||
Chs existingChs =
|
Chs existingChs =
|
||||||
ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CHS.Cylinders &&
|
_ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CHS.Cylinders &&
|
||||||
c.Heads == media.CHS.Heads &&
|
c.Heads == media.CHS.Heads &&
|
||||||
c.Sectors == media.CHS.Sectors);
|
c.Sectors == media.CHS.Sectors);
|
||||||
|
|
||||||
@@ -333,7 +335,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
if(media.CHS != null)
|
if(media.CHS != null)
|
||||||
{
|
{
|
||||||
Chs existingChs =
|
Chs existingChs =
|
||||||
ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CurrentCHS.Cylinders &&
|
_ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CurrentCHS.Cylinders &&
|
||||||
c.Heads == media.CurrentCHS.Heads &&
|
c.Heads == media.CurrentCHS.Heads &&
|
||||||
c.Sectors == media.CurrentCHS.Sectors);
|
c.Sectors == media.CurrentCHS.Sectors);
|
||||||
|
|
||||||
@@ -343,8 +345,8 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Reports.Add(newUploadedReport);
|
_ctx.Reports.Add(newUploadedReport);
|
||||||
ctx.SaveChanges();
|
_ctx.SaveChanges();
|
||||||
|
|
||||||
var pgpIn = new MemoryStream(Encoding.UTF8.GetBytes(reportJson));
|
var pgpIn = new MemoryStream(Encoding.UTF8.GetBytes(reportJson));
|
||||||
var pgpOut = new MemoryStream();
|
var pgpOut = new MemoryStream();
|
||||||
|
|||||||
Reference in New Issue
Block a user