Fix challonge event
Fix GenericController Fix ChallongeSave. Fix RestAPI in prod mode.
This commit is contained in:
@@ -10,7 +10,7 @@ namespace LaDOSE.Business.Interface
|
||||
{
|
||||
Task<List<ChallongeTournament>> GetTournaments(DateTime? start, DateTime? end);
|
||||
Task<Event> ParseSmash(string tournamentSlug);
|
||||
Task<List<Event>> ParseChallonge(List<int> ids);
|
||||
//Task<List<Event>> ParseChallonge(List<int> ids);
|
||||
|
||||
//Task<TournamentsResult> GetChallongeTournamentsResult(List<int> ids);
|
||||
//Task<TournamentsResult> GetSmashResult(string tournamentSlug);
|
||||
|
||||
@@ -197,14 +197,14 @@ namespace LaDOSE.Business.Provider.ChallongProvider
|
||||
Name = eventName,
|
||||
Date = Date,
|
||||
};
|
||||
this.EventService.AddOrUpdate(currentevent);
|
||||
//this.EventService.AddOrUpdate(currentevent);
|
||||
|
||||
return currentevent;
|
||||
}
|
||||
|
||||
private const string RegexRanking = @"[R|r]anking.?#\w{3}";
|
||||
private const string RegexRanking = @"[R|r]anking.?#\d{1,3}";
|
||||
private const string DateRanking = @"^\[(\d{2}\/\d{2}\/\d{2})\]";
|
||||
private const string GameRanking = @"\-.(\w*)$";
|
||||
private const string GameRanking = @"\-.((\w|\.|\s)*)$";
|
||||
public async Task<List<Event>> ParseEvent(List<int> idTournaments)
|
||||
{
|
||||
var result = new List<Event>();
|
||||
|
||||
@@ -85,7 +85,10 @@ namespace LaDOSE.Business.Provider.SmashProvider
|
||||
Game = games.FirstOrDefault(g => g.SmashId == e.videogame.id)
|
||||
|
||||
}).ToList();
|
||||
|
||||
if (tournaments.Any(e => !e.Finish))
|
||||
{
|
||||
throw new Exception("Tournament not finished.");
|
||||
}
|
||||
return new Event
|
||||
{
|
||||
SmashSlug = slug,
|
||||
|
||||
@@ -192,10 +192,11 @@ namespace LaDOSE.Business.Service
|
||||
|
||||
}
|
||||
|
||||
public Task<List<Event>> ParseChallonge(List<int> ids)
|
||||
{
|
||||
return _challongeProvider.ParseEvent(ids);
|
||||
}
|
||||
//public Task<List<Event>> ParseChallonge(List<int> ids)
|
||||
//{
|
||||
// return GetChallongeEvents(ids);
|
||||
// //return _challongeProvider.Get(ids);
|
||||
//}
|
||||
|
||||
private Event GetBySlug(string tournamentSlug)
|
||||
{
|
||||
@@ -220,6 +221,7 @@ namespace LaDOSE.Business.Service
|
||||
{
|
||||
var events = await this._challongeProvider.ParseEvent(ids);
|
||||
this._context.Event.AddRange(events);
|
||||
this._context.SaveChanges();
|
||||
return events;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user