Implement API call to set cue time.

This commit is contained in:
Matthew Stratford 2020-09-22 02:54:53 +01:00
parent c42737dae7
commit 844ad41721
2 changed files with 7 additions and 1 deletions

View file

@ -227,6 +227,12 @@ export function loadPlaylistLibrary(libraryId: string): Promise<Track[]> {
return myradioApiRequest("/playlist/" + libraryId + "/tracks", "GET", {});
}
export function setTimeslotItemCue(timeslotItemId: string, secs: number): Promise<null> {
return myradioApiRequest("/timeslotItem/" + timeslotItemId + "/cue", "PUT", {
start_time: secs
});
}
export function setTrackIntro(trackId: number, secs: number): Promise<null> {
return myradioApiRequest("/track/" + trackId + "/intro", "PUT", {
duration: secs

View file

@ -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);