Fixed warnings in code

This commit is contained in:
Joseph Milazzo 2021-01-01 14:18:29 -06:00
parent c429c50ba2
commit fa71a40990
8 changed files with 5 additions and 16 deletions

View File

@ -1,6 +1,5 @@
using System.Threading.Tasks;
using API.Entities;
using API.Interfaces;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;

View File

@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using API.Data;
using API.DTOs;
using API.Entities;
using API.Extensions;
@ -39,7 +38,6 @@ namespace API.Controllers
return BadRequest("Library name already exists. Please choose a unique name to the server.");
}
// TODO: We probably need to normalize the folders before we insert
var library = new Library
{
Name = createLibraryDto.Name.ToLower(),

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace API.DTOs
namespace API.DTOs
{
public class SeriesDto
{

View File

@ -6,7 +6,6 @@ using API.Entities;
using API.Interfaces;
using AutoMapper;
using AutoMapper.QueryableExtensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace API.Data

View File

@ -1,6 +1,5 @@
using System.Collections.Generic;
using API.DTOs;
using API.Entities;
namespace API.Interfaces
{

View File

@ -2,7 +2,6 @@
using System.Threading.Tasks;
using API.DTOs;
using API.Entities;
using Microsoft.AspNetCore.Mvc;
namespace API.Interfaces
{
@ -22,6 +21,5 @@ namespace API.Interfaces
bool SaveAll();
Library GetLibraryForName(string libraryName);
Task<IEnumerable<LibraryDto>> GetLibrariesForUsernameAysnc(string userName);
//Task<IEnumerable<Series>> GetSeriesForIdAsync(int libraryId);
}
}

View File

@ -5,7 +5,6 @@ using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security;
using System.Text.RegularExpressions;
using System.Threading;
@ -14,7 +13,6 @@ using API.DTOs;
using API.Entities;
using API.Interfaces;
using API.Parser;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace API.Services
@ -135,7 +133,7 @@ namespace API.Services
private Series UpdateSeries(string seriesName, ParserInfo[] infos)
{
var series = _seriesRepository.GetSeriesByName(seriesName);
ICollection<Volume> volumes = new List<Volume>();;
ICollection<Volume> volumes = new List<Volume>();
if (series == null)
{
@ -150,7 +148,7 @@ namespace API.Services
// BUG: This is creating new volume entries and not resetting each run.
IEnumerable<Volume> existingVolumes = _seriesRepository.GetVolumes(series.Id);
IList<Volume> existingVolumes = _seriesRepository.GetVolumes(series.Id).ToList();
foreach (var info in infos)
{
var existingVolume = existingVolumes.SingleOrDefault(v => v.Number == info.Volumes);

View File

@ -5,11 +5,11 @@ namespace API.Services
{
public class TaskScheduler : ITaskScheduler
{
private BackgroundJobServer Client { get; }
private readonly BackgroundJobServer _client;
public TaskScheduler()
{
Client = new BackgroundJobServer();
_client = new BackgroundJobServer();
}