feat: Implemented link game importing
feat: Implemented download page for downloading roms from various sources using plugins. Added support for internet archive external plugin. feat: Added tasks page to track running tasks/downloads feat: Added tanstack caching feat: Added quick play action Fixes #6 feat: Added quick emulator launch action fix: Made task queue only support 1 task per group and task ID should now be unique
This commit is contained in:
parent
9a3e605625
commit
9141fb35d4
70 changed files with 1922 additions and 560 deletions
30
src/bun/api/jobs/test-download-job.ts
Normal file
30
src/bun/api/jobs/test-download-job.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { DownloadJobData } from "@simeonradivoev/gameflow-sdk/shared";
|
||||
import { IJob, JobContext } from "@simeonradivoev/gameflow-sdk/task-queue";
|
||||
import { sleep } from "bun";
|
||||
|
||||
export class TestDownloadJob implements IJob<DownloadJobData, string>
|
||||
{
|
||||
data: DownloadJobData = {
|
||||
speed: 1686,
|
||||
downloaded: 0,
|
||||
total: 6615841,
|
||||
name: "Test Download Job"
|
||||
};
|
||||
|
||||
group = "test-download";
|
||||
|
||||
async start (context: JobContext<IJob<DownloadJobData, string>, DownloadJobData, string>): Promise<any>
|
||||
{
|
||||
for (let i = 0; i < 10; i++)
|
||||
{
|
||||
await sleep(1000);
|
||||
context.setProgress(i / 10 * 100, 'download');
|
||||
if (context.abortSignal.aborted) return;
|
||||
}
|
||||
}
|
||||
exposeData (): DownloadJobData
|
||||
{
|
||||
return this.data;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue