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 System.Threading.Tasks;
using API.Entities; using API.Entities;
using API.Interfaces;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;

View File

@ -1,7 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using API.Data;
using API.DTOs; using API.DTOs;
using API.Entities; using API.Entities;
using API.Extensions; using API.Extensions;
@ -39,7 +38,6 @@ namespace API.Controllers
return BadRequest("Library name already exists. Please choose a unique name to the server."); 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 var library = new Library
{ {
Name = createLibraryDto.Name.ToLower(), Name = createLibraryDto.Name.ToLower(),

View File

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

View File

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

View File

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

View File

@ -2,7 +2,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using API.DTOs; using API.DTOs;
using API.Entities; using API.Entities;
using Microsoft.AspNetCore.Mvc;
namespace API.Interfaces namespace API.Interfaces
{ {
@ -22,6 +21,5 @@ namespace API.Interfaces
bool SaveAll(); bool SaveAll();
Library GetLibraryForName(string libraryName); Library GetLibraryForName(string libraryName);
Task<IEnumerable<LibraryDto>> GetLibrariesForUsernameAysnc(string userName); 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.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Security; using System.Security;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
@ -14,7 +13,6 @@ using API.DTOs;
using API.Entities; using API.Entities;
using API.Interfaces; using API.Interfaces;
using API.Parser; using API.Parser;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace API.Services namespace API.Services
@ -135,7 +133,7 @@ namespace API.Services
private Series UpdateSeries(string seriesName, ParserInfo[] infos) private Series UpdateSeries(string seriesName, ParserInfo[] infos)
{ {
var series = _seriesRepository.GetSeriesByName(seriesName); var series = _seriesRepository.GetSeriesByName(seriesName);
ICollection<Volume> volumes = new List<Volume>();; ICollection<Volume> volumes = new List<Volume>();
if (series == null) if (series == null)
{ {
@ -150,7 +148,7 @@ namespace API.Services
// BUG: This is creating new volume entries and not resetting each run. // 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) foreach (var info in infos)
{ {
var existingVolume = existingVolumes.SingleOrDefault(v => v.Number == info.Volumes); var existingVolume = existingVolumes.SingleOrDefault(v => v.Number == info.Volumes);

View File

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