popcorn-official / popcorn-api

Popcorn Time is a multi-platform, free software BitTorrent client that includes an integrated media player. Compatible API Anime/Movies/Show Scrapper
https://popcorntime.app
MIT License
624 stars 100 forks source link

GET /movie/{imdb_id} returns an empty response for some imdb ids #82

Closed DeepSpace2 closed 6 years ago

DeepSpace2 commented 7 years ago

Empty responses are usually returned for imdb_ids that don't exist on popcorn.

But sometimes empty responses are returned for an existing imdb_id, for example tt1469304.

This is reproducible from the docs page (https://popcorntime.api-docs.io/api/movie) and directly from the browser:
https://tv-v2.api-fetch.website/movie/tt1469304

ChrisAlderson commented 7 years ago

Can confirm this issues.

I'll most likely make it return null in the next version or return a HTTP 204 NO CONTENT.

DeepSpace2 commented 7 years ago

Thanks but isn't there a bigger issue here? Why don't we get the same response for all valid requests?

ChrisAlderson commented 7 years ago

Your request to https://tv-v2.api-fetch.website/movie/tt1469304 is valid. The issue is here is id tt1469304 does not exist in the database and mongoose will just return nothing. You can see the method fired by this route here.