Couple fixes.
This commit is contained in:
parent
99cd1f8c22
commit
b984d755e1
2 changed files with 7 additions and 11 deletions
14
src/api.ts
14
src/api.ts
|
@ -106,7 +106,6 @@ export function getShowplan(showId: number): Promise<Showplan> {
|
|||
"GET",
|
||||
{}
|
||||
).then(res => {
|
||||
console.log(res);
|
||||
return Object.keys(res).map(x => res[x]);
|
||||
});
|
||||
}
|
||||
|
@ -214,17 +213,16 @@ export function updateShowplan(
|
|||
|
||||
export interface Timeslot {
|
||||
timeslotid: number,
|
||||
time: number,
|
||||
timeStr: string
|
||||
|
||||
starttime: number,
|
||||
starttimeStr: string,
|
||||
title: string
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function getCurrentAPITimeslot(): Promise<Timeslot> {
|
||||
export function getCurrentApiTimeslot(): Promise<Timeslot> {
|
||||
return myradioApiRequest(`/timeslot/userselectedtimeslot`, "GET", {}
|
||||
).then(res => {
|
||||
console.log(res);
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
@ -236,15 +234,13 @@ export interface User {
|
|||
sname: string,
|
||||
url: string,
|
||||
photo: string
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function getCurrentAPIUser(): Promise<User> {
|
||||
export function getCurrentApiUser(): Promise<User> {
|
||||
return myradioApiRequest(`/user/currentuser`, "GET", {}
|
||||
).then(res => {
|
||||
console.log(res);
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
|
|
@ -48,15 +48,15 @@ export const toggleTracklisting = (): AppThunk => dispatch => {
|
|||
};
|
||||
|
||||
export const tracklistStart = (player: number, trackid: number): AppThunk =>async (dispatch, getState) => {
|
||||
console.log("Attempting to tracklist: " + trackid);
|
||||
if (getState().broadcast.tracklisting) {
|
||||
console.log("Attempting to tracklist: " + trackid);
|
||||
getState().mixer.players[player].tracklistItemID = (await sendTracklistStart(trackid)).audiologid;
|
||||
}
|
||||
};
|
||||
|
||||
export const tracklistEnd = (tracklistitemid: number): AppThunk => async (dispatch, getState) => {
|
||||
console.log("Attempting to end tracklistitem: " + tracklistitemid);
|
||||
if (getState().broadcast.tracklisting) {
|
||||
console.log("Attempting to end tracklistitem: " + tracklistitemid);
|
||||
myradioApiRequest("/tracklistItem/" + tracklistitemid + "/endtime", "PUT", {});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue