Use bapsicle for direct track search

This commit is contained in:
Matthew Stratford 2021-03-21 13:19:29 +00:00
parent 29b746a40d
commit 2642d2d3fb

View file

@ -47,6 +47,20 @@ export async function myradioApiRequest(
}
}
export async function bapsicleApiRequest(
endpoint: string,
method: "GET" | "POST" | "PUT",
params: any
): Promise<any> {
const res = await apiRequest(
"http://webstudio-dev.ury.org.uk:13500" + endpoint,
method,
params
);
const json = await res.json();
return json;
}
export async function broadcastApiRequest<TRes = any>(
endpoint: string,
method: "GET" | "POST" | "PUT",
@ -180,12 +194,17 @@ export function searchForTracks(
artist: string,
title: string
): Promise<Array<Track>> {
return bapsicleApiRequest("/library/search/track", "GET", {
artist,
title,
});
/*
return myradioApiRequest("/track/search", "GET", {
artist,
title,
limit: 100,
digitised: true,
});
}); */
}
export interface NipswebPlaylist {