From 844ad41721b9046b0303620156359246afd1eb5b Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Tue, 22 Sep 2020 02:54:53 +0100 Subject: [PATCH] Implement API call to set cue time. --- src/api.ts | 6 ++++++ src/showplanner/Player.tsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index d6057df..5654845 100644 --- a/src/api.ts +++ b/src/api.ts @@ -227,6 +227,12 @@ export function loadPlaylistLibrary(libraryId: string): Promise { return myradioApiRequest("/playlist/" + libraryId + "/tracks", "GET", {}); } +export function setTimeslotItemCue(timeslotItemId: string, secs: number): Promise { + return myradioApiRequest("/timeslotItem/" + timeslotItemId + "/cue", "PUT", { + start_time: secs + }); +} + export function setTrackIntro(trackId: number, secs: number): Promise { return myradioApiRequest("/track/" + trackId + "/intro", "PUT", { duration: secs diff --git a/src/showplanner/Player.tsx b/src/showplanner/Player.tsx index 7e51dcc..ff069ad 100644 --- a/src/showplanner/Player.tsx +++ b/src/showplanner/Player.tsx @@ -78,7 +78,7 @@ const setTrackOutro = (trackid: number, secs: number, player: number): AppThunk const setTrackCue = (timeslotItemId: string, secs: number, player: number): AppThunk => async (dispatch) => { try { - //await api.setTimeslotItemCue(timeslotItemId, secs); + await api.setTimeslotItemCue(timeslotItemId, secs); dispatch(MixerState.setLoadedItemCue(player, secs)); } catch (e) { console.error(e);