Comments (6)
Not sure what you mean, can you explain?
from api-imdb.
If you call ImdbApi.setLocale(Locale) then the locale will be passed to ApiBuilder.setLocale(Locale).
Due the fact, that ApiBuilder is a static class and has a static reference of "ApiBuilder.imdbLocale".
This is fine in single threade environments where every request wants the same locale.
But if you have multiple threads and some of them wants to use a different Locale then you have a problem; cause then you must synchronize over all Imdb-Api-Calls and set the locale, so that each thread can use it's own locale.
The static reference can be there; as default, But then there should be the possibilit to give a different locale per request. The same is done in TheTVApi and TheMovieDBApi where you pass the language for every request instead of setting a static reference for language in those APIs.
I came to this, cause the ImdbApi does not deliver the same results for different locales; cause some values are localized. Let's regard the cast list: if I use Locale.US everything is fine, but for Locale the role is localized, so that you "(uncredited)" with Locale.US is not the same than with Locale.DE cause the additional values of roles are localized. That makes it very hard to decide for multiple languages if a actor is uncredited or not .. as example.
Therefore I use Locale.US for cast call and for the rest Locale.DE. But due multi-threading I had
to synchromnize the calls, cause I have to set the static locale before every request to have the expected result when multiple threads are used.
Perhaps it's clearer when you have a close look into the "ImbApiWrapper" class in the YAMJ3 project.
from api-imdb.
Furtheron I investigated that the API does not return all informations from the web page.
For example the parental guide is missing in the API;
also the API does not return the Top250 info for a movie; and sometime not the biography of a person.
So in YAMJ3 I needed to do some website calls in addition to the API calls to get all informations I want .. :-)
from api-imdb.
Just another thing:
Call "imdbApi.setLocale(Locale.US) in the ImdbApiTest constructor.
Otherwise the default locale (for me DE) will be used and for that country the parentalguid does not work ...
from api-imdb.
You have to remember that this is an "undocumented" API and that most of this is just guess work as to what does and doesn't work in terms of data.
I will refactor to make the locale a per-method call.
from api-imdb.
I know ... :-) ... Much better, that you have "documented" somehow ... :-)
from api-imdb.
Related Issues (10)
- Search doesn't work HOT 3
- No data for "Country" and no option for language HOT 1
- API doesn't work HOT 1
- Get additional values for person HOT 1
- Implement exception handling like in TheMovieDB api
- Handle errors when not internet connection is available
- Mojo executions don't work anymore HOT 3
- ImdbApi.getSearch() returns results with empty data
- DuplicateFileException with Android HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-imdb.