Improve mapping

This commit is contained in:
James Hawkins 2022-04-17 17:31:03 +01:00
parent 5b20d910e8
commit 22683c35a1

View File

@ -57,16 +57,14 @@ export const gDrivePlayerScraper: MWMediaProvider = {
async searchForMedia(query: MWQuery): Promise<MWProviderMediaResult[]> {
const searchRes = await fetch(`${CORS_PROXY_URL}https://api.gdriveplayer.us/v1/movie/search?title=${query.searchQuery}`).then((d) => d.json());
const results: MWProviderMediaResult[] = [];
for (const item of searchRes) {
results.push({
title: item.title,
year: item.year,
mediaId: item.imdb,
});
}
const results: MWProviderMediaResult[] = searchRes.map((item: any) => ({
title: item.title,
year: item.year,
mediaId: item.imdb,
}));
return results;
},
async getStream(media: MWPortableMedia): Promise<MWMediaStream> {