Files
gaseous-server/gaseous-server/Controllers/BackgroundTasksController.cs
Michael Green 25f1895fe5 Added feature to build collections of ROM's based on a filter (#76)
* fix: added visual feed back for mass rom matching

* chore(deps): EmulatorJS version bump

* chore(deps): nuget package version bump

* feat: added cover art to the emulator

* ci: updated .gitignore

* ci: remove .DS_Store files

* feat: updated the about box, and labeled the IGDB user score

* chore(deps): EmulatorJS version bump

* feat: start of collections build, and styling changes

* fix: updated PlatformMap.json file with more platforms and fixed SNES extensions

* feat: more progress on romsets

* doc: updated readme to include new screenshots and discord link

* fix: repairs an issue where the author column in signatures was too narrow

* chore(deps): EmulatorJS version bump

* feat: Collection build code mostly complete

* fix: renamed collection classes to avoid conflicts in Swagger

* Re-wrote collection builder to correct major bugs and performance

* Completed collection builder and zipper

* API changes completed

* Fixed some last minute Collections API bugs

* Collections mostly complete. Todo: delete button

* Completed collections build
2023-09-01 21:02:15 +10:00

44 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace gaseous_server.Controllers
{
[ApiController]
[Route("api/v1/[controller]")]
public class BackgroundTasksController : Controller
{
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
public List<ProcessQueue.QueueItem> GetQueue()
{
return ProcessQueue.QueueItems;
}
[HttpGet]
[Route("{TaskType}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult<ProcessQueue.QueueItem> ForceRun(ProcessQueue.QueueItemType TaskType, Boolean ForceRun)
{
foreach (ProcessQueue.QueueItem qi in ProcessQueue.QueueItems)
{
if (qi.AllowManualStart == true)
{
if (TaskType == qi.ItemType)
{
if (ForceRun == true)
{
qi.ForceExecute();
}
return qi;
}
}
}
return NotFound();
}
}
}