mirror of
https://github.com/movie-web/movie-web.git
synced 2025-01-12 11:39:08 +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[]> {
|
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 searchRes = await fetch(`${CORS_PROXY_URL}https://api.gdriveplayer.us/v1/movie/search?title=${query.searchQuery}`).then((d) => d.json());
|
||||||
|
|
||||||
const results: MWProviderMediaResult[] = [];
|
const results: MWProviderMediaResult[] = searchRes.map((item: any) => ({
|
||||||
for (const item of searchRes) {
|
title: item.title,
|
||||||
results.push({
|
year: item.year,
|
||||||
title: item.title,
|
mediaId: item.imdb,
|
||||||
year: item.year,
|
}));
|
||||||
mediaId: item.imdb,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async getStream(media: MWPortableMedia): Promise<MWMediaStream> {
|
async getStream(media: MWPortableMedia): Promise<MWMediaStream> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user