From 0a561b8b915d54b9af4ec077b28dd8822b0af355 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Tue, 22 Jun 2021 08:54:48 -0500 Subject: [PATCH] Add progress method to seeker API --- api/seeker/src/IpcClient.ts | 11 +++++++++++ api/seeker/src/index.ts | 1 + api/seeker/src/schema.ts | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 api/seeker/src/schema.ts diff --git a/api/seeker/src/IpcClient.ts b/api/seeker/src/IpcClient.ts index 1b7290a..d27ae27 100644 --- a/api/seeker/src/IpcClient.ts +++ b/api/seeker/src/IpcClient.ts @@ -24,4 +24,15 @@ export class IpcClient extends IpcClientS this.log("No response from seeker notifying added movie", e); }); } + + /** + * Get the states of the provided ticket IDs + */ + public async getMovieTicketStates(ticketIds: number[]) { + let response = await this.request("movie_ticket_states",ticketIds); + if (response.error) { + throw new Error("Failed to get movie ticket progress"); + } + return response.data; + } } diff --git a/api/seeker/src/index.ts b/api/seeker/src/index.ts index 86c02b3..dbce808 100644 --- a/api/seeker/src/index.ts +++ b/api/seeker/src/index.ts @@ -1,2 +1,3 @@ export * from "./constants"; export * from "./IpcClient"; +export * from "./schema"; diff --git a/api/seeker/src/schema.ts b/api/seeker/src/schema.ts new file mode 100644 index 0000000..28d3ff9 --- /dev/null +++ b/api/seeker/src/schema.ts @@ -0,0 +1,3 @@ +export interface ITicketState { + progress: number|null +}