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
622 stars 101 forks source link

Some trailers not working #46

Closed MrRory closed 7 years ago

MrRory commented 7 years ago

For example the trailer for Finding Dory: http://tv-v2.api-fetch.website/movies/1?keywords=dory

The value is "false", it being null or just "" would be beter.

ChrisAlderson commented 7 years ago

I'll change this line from false to null.

MrRory commented 7 years ago

let's hope the android app isn't going to break 😅

ChrisAlderson commented 7 years ago

I can hold back this issue if you want. I can also give you steps to setup your own API for development and testing purposes.

MrRory commented 7 years ago

probably gulp build && node ./build/popcorn-api.js?

I think it'll work, since it looks like the android code once depended on this being a youtube url, an empty string or null.

However, I'm not sure just changing that line to null will do it. Since the current response really gives false as string, that confuses me

ChrisAlderson commented 7 years ago

I think I implemented the false value because of the 'old' YTS API, which was used by the android and desktop version, but I'm not sure. Either way I don't think I'll change this for 2.2.2 until the purposed change by you can work for the android version and the desktop version. I know Java is basically a wooden plank in terms of code flexibility compared to JavaScript. So I think it's good to test it out before changing the API (and database values).

ChrisAlderson commented 7 years ago

@MrRory

A few things to install for the API are:

The simplest way to run the API is to follow the [installation]() instructions and then run npm start. I can give more personal details in if you contact me at chrisalderson@protonmail.com

ChrisAlderson commented 7 years ago

Also maybe the false value of 'trailer' gets converted to a String by Gson because the Movie.java model has a trailer property with a type of string. https://github.com/popcorn-official/popcorn-android/blob/development/base/src/main/java/butter/droid/base/providers/media/models/Movie.java#L31

vzamanillo commented 7 years ago

This change does not brake the Android codebase, and I am completely agree with the change, in order or preference, a null or empty value is better

ChrisAlderson commented 7 years ago

The default value for trailer will be null: a89a1027436b76f3c671764d90b186518634b421