public async Task <SearchReplaysResponse> SearchForReplaysByEvent(string group) { _logger.LogInformation("EventController.SearchForReplaysByEvent: group: " + group); var result = new SearchReplaysResponse(); var replayList = await sessionDatabase.FindReplaysByGroup(group, eventDatabase); result.Replays = new SearchReplaysResponse.SearchReplaysResponseEntry[replayList.Length]; for (int i = 0; i < replayList.Length; i++) { var repl = replayList[i]; result.Replays[i] = new SearchReplaysResponse.SearchReplaysResponseEntry() { App = repl.AppVersion, bIsLive = repl.IsLive, Changelist = repl.Changelist, DemoTimeInMs = repl.TotalDemoTimeMs, FriendlyName = repl.PlatformFriendlyName, NumViewers = repl.Viewers.Count, SessionName = repl.SessionName, SizeInBytes = repl.TotalUploadedBytes, Timestamp = repl.CreationDate.UtcDateTime, shouldKeep = false, }; } return(result); }
public async Task <SearchReplaysResponse> SearchReplays(string app, int?cl, string version, string meta, string user, bool?recent) { var result = new SearchReplaysResponse(); var replayList = await sessionDatabase.FindReplays(app, cl, version, meta, user, recent); result.Replays = new SearchReplaysResponse.SearchReplaysResponseEntry[replayList.Length]; for (int i = 0; i < replayList.Length; i++) { var repl = replayList[i]; result.Replays[i] = new SearchReplaysResponse.SearchReplaysResponseEntry() { App = repl.AppVersion, bIsLive = repl.IsLive, Changelist = repl.Changelist, DemoTimeInMs = repl.TotalDemoTimeMs, FriendlyName = repl.PlatformFriendlyName, NumViewers = repl.Viewers.Count, SessionName = repl.SessionName, SizeInBytes = repl.TotalUploadedBytes, Timestamp = repl.CreationDate.UtcDateTime, shouldKeep = false, }; } return(result); }