From 454c12a5a9a2169c5d6ace4c763c77b321c7bec1 Mon Sep 17 00:00:00 2001
From: darkstack <1835601+darkstack@users.noreply.github.com>
Date: Fri, 22 Mar 2024 23:58:43 +0100
Subject: [PATCH] Modification get smash
---
.../LaDOSE.Api/Controllers/GameController.cs | 11 +++-
.../Controllers/TournamentController.cs | 2 +-
LaDOSE.Src/LaDOSE.Api/Startup.cs | 3 +-
LaDOSE.Src/LaDOSE.DTO/GameDTO.cs | 2 +-
.../LaDOSE.DesktopApp.Avalonia/App.axaml.cs | 6 +++
.../LaDOSE.DesktopApp.Avalonia.csproj | 1 +
.../LaDOSE.DesktopApp.Avalonia/Program.cs | 49 +++++++++--------
.../Utils/CustomEqualityCompare.cs | 4 +-
.../ViewModels/GamesViewModel.cs | 15 ++++++
.../ViewModels/MainWindowViewModel.cs | 4 +-
.../ViewModels/TournamentResultViewModel.cs | 52 +++++++++----------
.../Views/GamesView.axaml | 20 +++++--
.../Views/TournamentResultView.axaml.cs | 2 +-
LaDOSE.Src/LaDOSE.REST/RestService.cs | 19 ++++++-
.../Interface/IExternalProviderService.cs | 3 ++
.../Interface/ISmashProvider.cs | 1 +
.../Provider/SmashProvider/SmashProvider.cs | 31 +++++++++++
.../Provider/SmashProvider/Tournament.cs | 5 +-
.../Service/ExternalProviderService.cs | 9 ++++
19 files changed, 176 insertions(+), 63 deletions(-)
diff --git a/LaDOSE.Src/LaDOSE.Api/Controllers/GameController.cs b/LaDOSE.Src/LaDOSE.Api/Controllers/GameController.cs
index f9e7c1d..36c9be7 100644
--- a/LaDOSE.Src/LaDOSE.Api/Controllers/GameController.cs
+++ b/LaDOSE.Src/LaDOSE.Api/Controllers/GameController.cs
@@ -17,8 +17,17 @@ namespace LaDOSE.Api.Controllers
[Produces("application/json")]
public class GameController : GenericControllerDTO
{
- public GameController(IMapper mapper,IGameService service) : base(mapper,service)
+ private IExternalProviderService provider;
+ public GameController(IMapper mapper,IGameService service, IExternalProviderService service2) : base(mapper,service)
{
+ provider = service2;
+ }
+ [HttpGet("smash/{name}")]
+ public async Task> GetIdFromSmash(string name)
+ {
+ var smashGame = await provider.GetSmashGame(name);
+
+ return _mapper.Map>(smashGame);;
}
}
}
diff --git a/LaDOSE.Src/LaDOSE.Api/Controllers/TournamentController.cs b/LaDOSE.Src/LaDOSE.Api/Controllers/TournamentController.cs
index 13413a9..3ab7942 100644
--- a/LaDOSE.Src/LaDOSE.Api/Controllers/TournamentController.cs
+++ b/LaDOSE.Src/LaDOSE.Api/Controllers/TournamentController.cs
@@ -19,7 +19,7 @@ namespace LaDOSE.Api.Controllers
private IMapper _mapper;
- // GET
+ // GETawa
public TournamentController(IMapper mapper, IExternalProviderService service)
{
_mapper = mapper;
diff --git a/LaDOSE.Src/LaDOSE.Api/Startup.cs b/LaDOSE.Src/LaDOSE.Api/Startup.cs
index 41581e8..70ba219 100644
--- a/LaDOSE.Src/LaDOSE.Api/Startup.cs
+++ b/LaDOSE.Src/LaDOSE.Api/Startup.cs
@@ -24,6 +24,7 @@ using LaDOSE.Entity.Wordpress;
using Result = LaDOSE.Entity.Challonge.Result;
using LaDOSE.Entity.BotEvent;
using Microsoft.EntityFrameworkCore.Storage;
+using Microsoft.Extensions.Hosting;
namespace LaDOSE.Api
{
@@ -163,7 +164,7 @@ namespace LaDOSE.Api
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
- public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
+ public void Configure(IApplicationBuilder app, IHostEnvironment env, ILoggerFactory loggerFactory)
{
//loggerFactory.AddConsole(Configuration.GetSection("Logging"));
//loggerFactory.AddDebug();
diff --git a/LaDOSE.Src/LaDOSE.DTO/GameDTO.cs b/LaDOSE.Src/LaDOSE.DTO/GameDTO.cs
index 3b63759..80ccbe9 100644
--- a/LaDOSE.Src/LaDOSE.DTO/GameDTO.cs
+++ b/LaDOSE.Src/LaDOSE.DTO/GameDTO.cs
@@ -1,7 +1,7 @@
namespace LaDOSE.DTO
{
public class GameDTO
- {
+ {
public int Id { get; set; }
public string Name { get; set; }
public string LongName { get; set; }
diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml.cs
index a01c976..b9790bf 100644
--- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml.cs
+++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml.cs
@@ -3,6 +3,8 @@ using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using LaDOSE.DesktopApp.Avalonia.ViewModels;
using LaDOSE.DesktopApp.Avalonia.Views;
+using LaDOSE.REST;
+using MsBox.Avalonia;
using ReactiveUI;
using Splat;
@@ -10,6 +12,10 @@ namespace LaDOSE.DesktopApp.Avalonia;
public partial class App : Application
{
+
+
+
+
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj
index 556a59c..7ba3dfa 100644
--- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj
+++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj
@@ -23,6 +23,7 @@
+
diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs
index 597f1ad..a787393 100644
--- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs
+++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs
@@ -5,6 +5,8 @@ using System.ComponentModel;
using System.IO;
using LaDOSE.REST;
using Microsoft.Extensions.Configuration;
+using MsBox.Avalonia;
+using MsBox.Avalonia.Enums;
using Splat;
// using Xilium.CefGlue;
// using Xilium.CefGlue.Common;
@@ -22,23 +24,36 @@ sealed class Program
public static void Main(string[] args)
{
RegisterDependencies(Locator.CurrentMutable, Locator.Current);
- BuildAvaloniaApp()
- .StartWithClassicDesktopLifetime(args);
+
+ var app = BuildAvaloniaApp();
+ app.StartWithClassicDesktopLifetime(args);
}
private static void RegisterDependencies(IMutableDependencyResolver currentMutable, IReadonlyDependencyResolver current)
{
- var builder = new ConfigurationBuilder()
- .AddJsonFile("settings.json", optional: true, reloadOnChange: true).Build();
- var restUrl = builder["REST:Url"].ToString();
- var restUser = builder["REST:User"].ToString();
- var restPassword = builder["REST:Password"].ToString();
- currentMutable.RegisterLazySingleton(()=>
- {
- var restService = new RestService();
- restService.Connect(new Uri(restUrl),restUser,restPassword);
- return restService;
- });
+
+ var builder = new ConfigurationBuilder()
+ .AddJsonFile("settings.json", optional: true, reloadOnChange: true).Build();
+ var restUrl = builder["REST:Url"].ToString();
+ var restUser = builder["REST:User"].ToString();
+ var restPassword = builder["REST:Password"].ToString();
+
+ currentMutable.RegisterLazySingleton(() =>
+ {
+ var restService = new RestService();
+ try
+ {
+ restService.Connect(new Uri(restUrl), restUser, restPassword);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+
+ }
+
+ return restService;
+ });
+
}
// Avalonia configuration, don't remove; also used by visual designer.
@@ -48,13 +63,5 @@ sealed class Program
.UsePlatformDetect()
.WithInterFont()
.LogToTrace()
- .AfterSetup(_ =>
- {
- // CefRuntimeLoader.Initialize(new CefSettings()
- // {
- // WindowlessRenderingEnabled = true,
- // NoSandbox = true,
- // });
- })
.UseReactiveUI();
}
\ No newline at end of file
diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/CustomEqualityCompare.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/CustomEqualityCompare.cs
index de22e5d..c3c49af 100644
--- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/CustomEqualityCompare.cs
+++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/CustomEqualityCompare.cs
@@ -14,14 +14,14 @@ namespace LaDOSE.DesktopApp.Avalonia.Utils
_compare = c;
}
- public bool Equals(T x, T y)
+ public bool Equals(T? x, T? y)
{
return _compare(x, y);
}
public int GetHashCode(T obj)
{
- return 0;
+ return obj.GetHashCode();
}
}
}
diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/GamesViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/GamesViewModel.cs
index 687a305..1898bf4 100644
--- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/GamesViewModel.cs
+++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/GamesViewModel.cs
@@ -18,6 +18,7 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
private GameDTO _currentGame;
private List _games;
+ private List _Searchgames;
private RestService RestService { get; set; }
public GamesViewModel(IScreen screen): base(screen,"Games")
{
@@ -26,6 +27,7 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
OnInitialize();
}
+
void OnInitialize()
{
LoadGames();
@@ -49,6 +51,15 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
}
}
+ public List SearchGame
+ {
+ get => _Searchgames;
+ set
+ {
+ _Searchgames = value;
+ RaisePropertyChanged(nameof(this.SearchGame));
+ }
+ }
public GameDTO CurrentGame
{
get => _currentGame;
@@ -79,6 +90,10 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
LoadGames();
}
+ public void GetGame()
+ {
+ SearchGame = this.RestService.GetSmashGames(this.CurrentGame.LongName);
+ }
public bool CanDeleteGame => CurrentGame != null;
diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/MainWindowViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/MainWindowViewModel.cs
index 699e202..3ecdcd9 100644
--- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/MainWindowViewModel.cs
+++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/MainWindowViewModel.cs
@@ -10,7 +10,7 @@ public class MainWindowViewModel : Window
public void CloseApp()
{
- if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime)
- ((IClassicDesktopStyleApplicationLifetime)Application.Current.ApplicationLifetime).Shutdown();
+ if (Application.Current != null && Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime)
+ ((Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)!).Shutdown();
}
}
\ No newline at end of file
diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/TournamentResultViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/TournamentResultViewModel.cs
index 20f17c4..3fc82dd 100644
--- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/TournamentResultViewModel.cs
+++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/TournamentResultViewModel.cs
@@ -21,16 +21,16 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
{
public string DisplayName => "Tournament Result";
- private RestService RestService { get; set; }
+ private RestService? RestService { get; set; }
//Dictionary> _computedResult;
#region Properties
private string css = string.Empty;
- private String _selectRegex;
+ private string? _selectRegex;
- public String SelectRegex
+ public string? SelectRegex
{
get { return _selectRegex; }
set
@@ -40,9 +40,9 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
}
}
- private String _selectEventRegex;
+ private string? _selectEventRegex;
- public String SelectEventRegex
+ public string? SelectEventRegex
{
get { return _selectEventRegex; }
set
@@ -51,8 +51,8 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
RaisePropertyChanged(nameof(SelectEventRegex));
}
}
- private string _slug;
- public String Slug
+ private string? _slug;
+ public string? Slug
{
get { return _slug; }
set
@@ -62,9 +62,9 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
}
}
- private String _html;
+ private string? _html;
- public String Html
+ public string? Html
{
get { return $"{HtmlContent}"; }
set
@@ -72,9 +72,9 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
_html = value;
}
}
- private String _htmlContent;
+ private string? _htmlContent;
- public String HtmlContent
+ public string? HtmlContent
{
get { return _htmlContent; }
set
@@ -112,12 +112,12 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
}
- private TournamentsResultDTO _results;
+ private TournamentsResultDTO? _results;
public List Tournaments { get; set; }
public List Events { get; set; }
- public TournamentsResultDTO Results
+ public TournamentsResultDTO? Results
{
get => _results;
set
@@ -151,10 +151,10 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
}
}
- private GameDTO _selectedGame;
+ private GameDTO? _selectedGame;
- public GameDTO SelectedGame
+ public GameDTO? SelectedGame
{
get { return _selectedGame; }
set
@@ -172,9 +172,9 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
}
}
- private ObservableCollection _selectedGameResult;
+ private ObservableCollection? _selectedGameResult;
- public ObservableCollection SelectedGameResult
+ public ObservableCollection? SelectedGameResult
{
get { return _selectedGameResult; }
set
@@ -184,11 +184,11 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
}
}
- private String _first;
- private DataTable _gridDataTable;
- private string _error;
+ private string? _first;
+ private DataTable? _gridDataTable;
+ private string? _error;
- public String First
+ public string? First
{
get { return _first; }
set
@@ -252,7 +252,7 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
}
- public DataTable GridDataTable
+ public DataTable? GridDataTable
{
get => _gridDataTable;
set
@@ -262,7 +262,7 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
RaisePropertyChanged(nameof(GridDataTableView));
}
}
- public DataView GridDataTableView
+ public DataView? GridDataTableView
{
get
{
@@ -293,7 +293,7 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
}
- public string Error
+ public string? Error
{
get => _error;
set
@@ -356,7 +356,7 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
StringBuilder sb = new StringBuilder();
- DataTable grid = new DataTable();
+ DataTable? grid = new DataTable();
var games = Results.Games.Distinct().OrderBy(e => e.Order).ToList();
grid.Columns.Add("Players");
games.ForEach(e => grid.Columns.Add(e.Name.Replace('.', ' '),typeof(Int32)));
@@ -468,7 +468,7 @@ namespace LaDOSE.DesktopApp.Avalonia.ViewModels
{
sb.AppendLine($"
1/ {top3[0]}
2/ {top3[1]}
3/ {top3[2]}
");
//https://challonge.com/fr/{enumerable.First().TournamentUrl}
- var url = enumerable.FirstOrDefault().TournamentUrl;
+ string url = enumerable.FirstOrDefault()?.TournamentUrl;
url = url.Replace(" ", "-");
url = url.Replace(".", "-");
sb.AppendLine($"Voir le Bracket
");
diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml
index a5a6230..f7f31a9 100644
--- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml
+++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml
@@ -2,9 +2,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="650"
x:Class="LaDOSE.DesktopApp.Avalonia.Views.GamesView"
xmlns:vm="using:LaDOSE.DesktopApp.Avalonia.ViewModels"
+ xmlns:dto="clr-namespace:LaDOSE.DTO;assembly=LaDOSE.DTO"
x:DataType="vm:GamesViewModel"
>
@@ -42,6 +43,7 @@
+
@@ -71,11 +73,19 @@
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml.cs
index b66c806..5a7f139 100644
--- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml.cs
+++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml.cs
@@ -24,7 +24,7 @@ namespace LaDOSE.DesktopApp.Avalonia.Views
object? IViewFor.ViewModel
{
get => ViewModel;
- set => ViewModel = (TournamentResultViewModel)value;
+ set => ViewModel = (TournamentResultViewModel)value!;
}
public TournamentResultViewModel? ViewModel { get; set; }
diff --git a/LaDOSE.Src/LaDOSE.REST/RestService.cs b/LaDOSE.Src/LaDOSE.REST/RestService.cs
index 034406d..eee227b 100644
--- a/LaDOSE.Src/LaDOSE.REST/RestService.cs
+++ b/LaDOSE.Src/LaDOSE.REST/RestService.cs
@@ -24,6 +24,7 @@ namespace LaDOSE.REST
public event EventHandler UpdatedJwtEvent;
+
public RestService()
{
@@ -33,7 +34,15 @@ namespace LaDOSE.REST
public void Connect(Uri url, string user, string password)
{
Client = new RestClient(url);
- string token = GetToken(user, password);
+ string token;
+ try
+ {
+ token = GetToken(user, password);
+ }
+ catch (Exception)
+ {
+ return;
+ }
Client = new RestClient(url, options =>
{
#if DEBUG
@@ -204,6 +213,14 @@ namespace LaDOSE.REST
var restResponse = Client.Get>(restRequest);
return restResponse;
}
+
+ public List GetSmashGames(string name)
+ {
+ CheckToken();
+ var restRequest = new RestRequest($"/api/Game/Smash/{name}", Method.Get);
+ var restResponse = Client.Get>(restRequest);
+ return restResponse;
+ }
public GameDTO UpdateGame(GameDTO game)
{
diff --git a/LaDOSE.Src/LaDOSE.Service/Interface/IExternalProviderService.cs b/LaDOSE.Src/LaDOSE.Service/Interface/IExternalProviderService.cs
index a46c34e..dfe0247 100644
--- a/LaDOSE.Src/LaDOSE.Service/Interface/IExternalProviderService.cs
+++ b/LaDOSE.Src/LaDOSE.Service/Interface/IExternalProviderService.cs
@@ -10,6 +10,9 @@ namespace LaDOSE.Business.Interface
{
Task> GetTournaments(DateTime? start, DateTime? end);
Task ParseSmash(string tournamentSlug);
+
+ Task> GetSmashGame(string name);
+
//Task> ParseChallonge(List ids);
//Task GetChallongeTournamentsResult(List ids);
diff --git a/LaDOSE.Src/LaDOSE.Service/Interface/ISmashProvider.cs b/LaDOSE.Src/LaDOSE.Service/Interface/ISmashProvider.cs
index 2863f2b..d32aaf3 100644
--- a/LaDOSE.Src/LaDOSE.Service/Interface/ISmashProvider.cs
+++ b/LaDOSE.Src/LaDOSE.Service/Interface/ISmashProvider.cs
@@ -18,6 +18,7 @@ namespace LaDOSE.Business.Interface
Task GetNames(string slug);
+ Task> GetGames(string name);
}
}
\ No newline at end of file
diff --git a/LaDOSE.Src/LaDOSE.Service/Provider/SmashProvider/SmashProvider.cs b/LaDOSE.Src/LaDOSE.Service/Provider/SmashProvider/SmashProvider.cs
index 2303293..cb5c453 100644
--- a/LaDOSE.Src/LaDOSE.Service/Provider/SmashProvider/SmashProvider.cs
+++ b/LaDOSE.Src/LaDOSE.Service/Provider/SmashProvider/SmashProvider.cs
@@ -47,6 +47,37 @@ namespace LaDOSE.Business.Provider.SmashProvider
return graphQLResponse.Data;
}
+ public async Task> GetGames(string game)
+ {
+ var query = new GraphQLRequest()
+ {
+ Query = @"
+ query VideogameQuery($name:String) {
+ videogames(query: { filter: { name: $name }, perPage: 5 }) {
+ nodes {
+ id
+ name
+ displayName
+ }
+ }
+ }
+ ",
+ OperationName = "VideogameQuery",
+ Variables = new
+ {
+ name = game,
+ }
+ };
+ VideoGamesResponse querySmash = await QuerySmash(query);
+ if (querySmash.videogames != null)
+ {
+ return querySmash.videogames.nodes.Select(e => new Game() { Id = e.id, Name = e.Name }).ToList();
+ }
+
+ return new List();
+
+ }
+
public async Task GetEvent(string slug)
{
diff --git a/LaDOSE.Src/LaDOSE.Service/Provider/SmashProvider/Tournament.cs b/LaDOSE.Src/LaDOSE.Service/Provider/SmashProvider/Tournament.cs
index c1d66ad..79c9b0d 100644
--- a/LaDOSE.Src/LaDOSE.Service/Provider/SmashProvider/Tournament.cs
+++ b/LaDOSE.Src/LaDOSE.Service/Provider/SmashProvider/Tournament.cs
@@ -120,7 +120,10 @@ namespace LaDOSE.Business.Provider.SmashProvider
}
-
+ public class VideoGamesResponse
+ {
+ public Node? videogames {get; set; }
+ }
public class TournamentResponse
diff --git a/LaDOSE.Src/LaDOSE.Service/Service/ExternalProviderService.cs b/LaDOSE.Src/LaDOSE.Service/Service/ExternalProviderService.cs
index 1266a34..b131470 100644
--- a/LaDOSE.Src/LaDOSE.Service/Service/ExternalProviderService.cs
+++ b/LaDOSE.Src/LaDOSE.Service/Service/ExternalProviderService.cs
@@ -78,6 +78,10 @@ namespace LaDOSE.Business.Service
//}
}
+ public async Task> GetSmashGames(string name)
+ {
+ return await _smashProvider.GetGames(name);
+ }
public async Task ParseSmash(string tournamentSlug)
{
Event eventExist = GetBySlug(tournamentSlug);
@@ -109,6 +113,11 @@ namespace LaDOSE.Business.Service
}
+ public Task> GetSmashGame(string name)
+ {
+ return _smashProvider.GetGames(name);
+ }
+
private Event GetBySlug(string tournamentSlug)
{
return _context.Event.FirstOrDefault(e => e.SmashSlug == tournamentSlug);