Hacked around build errors
This commit is contained in:
parent
14fc1fbce6
commit
f7031852a7
|
|
@ -10,9 +10,9 @@ export default function Search() {
|
|||
const [query, setQuery] = useState<string>("");
|
||||
const [result, setResult] = useState<Serie[]>([]);
|
||||
|
||||
const onSearch = async (event) => {
|
||||
const onSearch = async (event: any) => {
|
||||
|
||||
const [status, response] = await post("/api/search", {
|
||||
const [status, response] = await post<any>("/api/search", {
|
||||
query
|
||||
});
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ export default function Search() {
|
|||
placeholder="NRK-podcast"
|
||||
className="border-2"
|
||||
value={query}
|
||||
onInput={(event) => { setQuery(event.target.value) }} />
|
||||
onInput={(event: any) => { setQuery(event.target.value) }} />
|
||||
<button
|
||||
className="my-2 bg-gray-100"
|
||||
onClick={onSearch}>Søk</button>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export type Episode = {
|
|||
async function withDownloadLink(withoutUrl: Omit<Episode, "url">) {
|
||||
|
||||
// getting stream link
|
||||
const [playbackStatus, playbackResponse] = await get(`https://psapi.nrk.no/playback/manifest/podcast/${withoutUrl.episodeId}`)
|
||||
const [playbackStatus, playbackResponse] = await get<any>(`https://psapi.nrk.no/playback/manifest/podcast/${withoutUrl.episodeId}`)
|
||||
|
||||
if (playbackStatus === OK) {
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ async function withDownloadLink(withoutUrl: Omit<Episode, "url">) {
|
|||
|
||||
export const nrkRadio = {
|
||||
search: async (query: string): Promise<Serie[]> => {
|
||||
const [status, response] = await get(`https://psapi.nrk.no/radio/search/search?q=${query}`);
|
||||
const [status, response] = await get<any>(`https://psapi.nrk.no/radio/search/search?q=${query}`);
|
||||
if (status === OK) {
|
||||
const series = response.results.series.results
|
||||
return series as Serie[];
|
||||
|
|
@ -54,8 +54,8 @@ export const nrkRadio = {
|
|||
[episodeStatus, episodeResponse],
|
||||
[seriesStatus, serieResponse],
|
||||
] = await Promise.all([
|
||||
get(`https://psapi.nrk.no/radio/catalog/podcast/${seriesId}/episodes`),
|
||||
get(`https://psapi.nrk.no/radio/catalog/podcast/${seriesId}`)
|
||||
get<any>(`https://psapi.nrk.no/radio/catalog/podcast/${seriesId}/episodes`),
|
||||
get<any>(`https://psapi.nrk.no/radio/catalog/podcast/${seriesId}`)
|
||||
]);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,23 +3,23 @@ import { HandlerContext } from "$fresh/server.ts";
|
|||
|
||||
import { serialize, tag, declaration } from "https://deno.land/x/serializexml@v0.3.2/mod.ts";
|
||||
|
||||
function toItemTag(episode: Episode): string {
|
||||
function toItemTag(episode: Episode) {
|
||||
return tag("item", [
|
||||
tag("title", episode.title),
|
||||
tag("title", episode.titles.title),
|
||||
tag("link", episode.url),
|
||||
tag("description", episode.description),
|
||||
tag("itunes:summary", episode.description),
|
||||
tag("guid", episode.id, ["isPermaLink", "false"]),
|
||||
tag("description", episode.titles.description),
|
||||
tag("itunes:summary", episode.titles.description),
|
||||
tag("guid", episode.id, [["isPermaLink", "false"]]),
|
||||
tag("pubDate", episode.date),
|
||||
tag("enclosure", "", [
|
||||
["url", episode.url],
|
||||
["length", episode.durationInSeconds],
|
||||
["length", episode.durationInSeconds.toString()],
|
||||
["type", "audio/mpeg3"],
|
||||
]),
|
||||
])
|
||||
}
|
||||
|
||||
async function buildFeed(seriesId) {
|
||||
async function buildFeed(seriesId: any) {
|
||||
const serie = await nrkRadio.getSerieData(seriesId)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue