Skip to content

Commit

Permalink
Automatic Code Clean up: remove unused usings, fix formatting
Browse files Browse the repository at this point in the history
Removed unused `using` directives from multiple files to clean up the code. Corrected namespace declarations and added missing curly braces in `PreviewShareListDto.cs`. Adjusted constructor parameters in `GetPelisPlusLatMoviesCommandHandler` and fixed minor formatting issues in several files, including `SearchShareListQuery.cs`, `ShareListController.cs`, and `WebScrapingModuleController.cs`. Removed redundant namespace declarations and fixed a missing semicolon in `GenericRepository.cs`.
  • Loading branch information
AbreuHD committed Feb 9, 2025
1 parent 9c07bce commit aab044c
Show file tree
Hide file tree
Showing 21 changed files with 17 additions and 67 deletions.
8 changes: 1 addition & 7 deletions Core.Application/DTOs/ShareList/PreviewShareListDto.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Application.DTOs.ShareList
namespace Core.Application.DTOs.ShareList
{
public class PreviewShareListDto
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class GetPelisPlusLatMoviesCommand : IRequest<bool>
}
public class GetPelisPlusLatMoviesCommandHandler(
IScrapPageRepository scrapPageRepository,
IMovieWebRepository movieWebRepository,
IMovie_MovieWebRepository movie_MovieWebRepository,
IMovieRepository movieRepository,
GetTmdbData getTmdbData,
IMovieWebRepository movieWebRepository,
IMovie_MovieWebRepository movie_MovieWebRepository,
IMovieRepository movieRepository,
GetTmdbData getTmdbData,
ILogger<GetPelisPlusLatMoviesCommandHandler> logger,
IMapper mapper) : IRequestHandler<GetPelisPlusLatMoviesCommand, bool>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Core.Application.DTOs.Genres;
using Core.Application.DTOs.Movies;
using Core.Application.Interface.Repositories;
using Core.Domain.Entities.Movie;
using Core.Domain.Entities.Relations;
using MediatR;
using System.Net;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
using Core.Domain.Entities.Relations;
using MediatR;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace Core.Application.Features.ShareListModule.Commands
{
Expand Down Expand Up @@ -41,7 +36,7 @@ public async Task<GenericApiResponse<bool>> Handle(AddItemToShareListCommand req
return response;
}

if (request.IsMovie)
if (request.IsMovie)
{
var movieExist = await _movieList_MovieRepository.ItemExist(request.ItemId, request.ShareListId);
if (movieExist)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
using Auth.Core.Application.DTOs.Generic;
using Core.Application.Interface.Repositories;
using Core.Domain.Entities.Relations;
using MediatR;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace Core.Application.Features.ShareListModule.Commands
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
using Core.Domain.Entities.UserThings;
using MediatR;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Application.Features.ShareListModule.Commands
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Auth.Core.Application.DTOs.Generic;
using AutoMapper;
using Core.Application.Interface.Repositories;
using Core.Domain.Entities.UserThings;
using MediatR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
using Core.Application.DTOs.ShareList;
using Core.Application.Interface.Repositories;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Application.Features.ShareListModule.Queries
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
using Core.Application.DTOs.ShareList;
using Core.Application.Interface.Repositories;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Application.Features.ShareListModule.Queries
{
public class SearchShareListQuery : IRequest<GenericApiResponse<List<PreviewShareListDto>>>
{
public string? Name { get; set; }
public string? Name { get; set; }
}
public class SearchShareListQueryHandler : IRequestHandler<SearchShareListQuery, GenericApiResponse<List<PreviewShareListDto>>>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
using Core.Application.DTOs.ShareList;
using Core.Application.Interface.Repositories;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Application.Features.ShareListModule.Queries
{
Expand Down
1 change: 0 additions & 1 deletion Core.Application/ServiceRegistration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Core.Application.Helpers.TMDB;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Core.Application.DTOs.Scraping;
using Core.Domain.Entities.WebScraping;
using HtmlAgilityPack;
using ScrapySharp.Extensions;
using System;
using System.Net;

namespace Core.Application.Services.WebScrapers.MovieESWebsites.Cuevana
Expand Down
3 changes: 1 addition & 2 deletions Core.Domain/Entities/UserThings/Recents.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Auth.Infraestructure.Identity.Entities;
using Core.Domain.Common;
using Core.Domain.Common;

namespace Core.Domain.Entities.UserThings
{
Expand Down
3 changes: 1 addition & 2 deletions Core.Domain/Entities/UserThings/ShareList.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Auth.Infraestructure.Identity.Entities;
using Core.Domain.Common;
using Core.Domain.Common;
using Core.Domain.Entities.Relations;

namespace Core.Domain.Entities.UserThings
Expand Down
3 changes: 1 addition & 2 deletions Infraestructure.Persistence/Context/KhakuContext.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Auth.Infraestructure.Identity.Entities;
using Core.Domain.Common;
using Core.Domain.Common;
using Core.Domain.Entities.Movie;
using Core.Domain.Entities.Relations;
using Core.Domain.Entities.UserThings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public virtual async Task<List<Entity>> GetAllWithIncludes(List<string> properti

public virtual async Task<Entity> GetByIdAsync(int Id)
{
return await _dbcontext.Set<Entity>().FindAsync(Id)
return await _dbcontext.Set<Entity>().FindAsync(Id)
?? throw new KeyNotFoundException($"{typeof(Entity).Name} not found");
}
public virtual async Task<Entity> GetByStringIdAsync(string Id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Core.Application.Interface.Repositories;
using Core.Domain.Entities.Relations;
using Core.Domain.Entities.UserThings;
using Infrastructure.Persistence.Context;
using Microsoft.EntityFrameworkCore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using System.Net.Mime;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;

namespace KuhakuCentral.Controllers.V1.ShareListModule
{
Expand All @@ -20,7 +19,7 @@ public class ShareListController : BaseApi
Summary = "Create List",
Description = "Endpoint to create a new Share list of movies and series"
)]
public async Task<IActionResult> CreateList([FromBody]CreateNewListCommand command)
public async Task<IActionResult> CreateList([FromBody] CreateNewListCommand command)
{
command.UserId = User.FindFirst("uid")!.Value;
var response = await Mediator.Send(command);
Expand Down Expand Up @@ -59,7 +58,7 @@ public async Task<IActionResult> LogedUserList()
)]
public async Task<IActionResult> AllShareList(string? name)
{
var response = await Mediator.Send(new SearchShareListQuery { Name = name ?? string.Empty } );
var response = await Mediator.Send(new SearchShareListQuery { Name = name ?? string.Empty });
return StatusCode(response.Statuscode, response);
}

Expand Down Expand Up @@ -117,7 +116,7 @@ public async Task<IActionResult> UserShareList(AddItemToShareListCommand command
Summary = "Search for User Share Lists by Id",
Description = "Endpoint to Search for User Share Lists"
)]
public async Task<IActionResult> AddItemToShareList([FromBody]AddItemToShareListCommand command)
public async Task<IActionResult> AddItemToShareList([FromBody] AddItemToShareListCommand command)
{
command.UserId = User.FindFirst("uid")!.Value;
var response = await Mediator.Send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class WebScrapingModuleController : BaseApi
)]
public async Task<IActionResult> ScrapPage(int Id)
{
switch(Id)
switch (Id)
{
case 1:
await Mediator.Send(new GetAllCuevanaMoviesCommand());
Expand Down

0 comments on commit aab044c

Please sign in to comment.