mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-24 18:41:48 +01:00
Improve mapping
This commit is contained in:
parent
5b20d910e8
commit
22683c35a1
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user