lordmike / tmdblib Goto Github PK
View Code? Open in Web Editor NEWC#.Net library for TheMovieDB
License: MIT License
C#.Net library for TheMovieDB
License: MIT License
Is there a way to search tmdb by recent deaths? As an example, get a collection of people who have passed away in the last week.
Add the following missing lists actions:
Hi,
I have an issue with getting trailer in different languages. I tried
client.DefaultLanguage = "de";
var trailers = client.GetMovieTrailers(Id);
But I am only getting the English language trailer.
The Trailer itself are empty when requesting the movie in another language via
client.DefaultLanguage = "de";
Movie myMovie = client.GetMovie(Id);
Do I do something wrong? I looked it up in the code but I couldn't find the correct position.
Thanks in advance!
IMDB's API get results have it as shown in JSON as:
"imdb_id": "tt0137523",
"original_language": "en",
"original_title": "Fight Club"
Any change it can be added to the wrapper available from Nuget. I don't code in C or I'd have a go myself. I'm a bit old school and code in VB/VB.net. I looked at your source movie objects and see not reference to "original_language". Did I miss something?
thx
Joe
I did not find code for authentication of regular user sessions, so I added it.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TMDbLib.Objects.Authentication
{
public class TokenLight
{
public string RequestToken { get; set; }
public bool Success { get; set; }
}
}
and
public TokenLight AuthenticationValidateWithLogin(string initialRequestToken, string username, string password)
{
RestRequest request = new RestRequest("authentication/token/validate_with_login");
request.AddParameter("request_token", initialRequestToken);
request.AddParameter("username", username);
request.AddParameter("password", password);
IRestResponse<TokenLight> response = _client.Get<TokenLight>(request);
return response.Data;
}
Dear LordMike,
Just an idea, but isn't it possible to convert the (excellent) TMDbLib project to a Portable Class Library (PCL). You would have to drop the RestSharp reference, but a PCL can make use of the ASP.NET Web API client to collect and parse JSON data.
Like I said... It's just an idea, but after the conversion the TMDbLib can be referenced by another PCL and be used in several project types (Win8, WinPhone8, etc).
Dave
By far of all the librariries for tmdb .net I've seen that you guys are doing a great job. specifically because you're responsive and are taking a genuine interest in making this widely available and easy to use and keeping it upto date. I'll be happy to spread the word (and make a donation if you guys accept it).
I would really love to see some documentation of the library API's, what the API's do, what parameters they accept and mean (e.g. what does page = -1 do). Also would love to see a guide to getting started with the API's, you've put 10 lines I see but it isn't enough to get started, possibly a list of all API's (atleast the high level, collectins, movies etc) that way we don't need to go hunting around to see what's available and which namespaces to include and importantly you keep us away from looking at the tmdb website trying to reverse engineer what you've done by looing at what they return and how their api's work (whcih I assume is the primary goal of this library).
Thanks and keep up the great work.
Hi !
Would be great if it was possible to support async request with the client, or having a second TMDBClient that does async handling.
Do you have support to search TV show by title. I noticed that the TMDB Api supports that, but I couldn't find any method in your wrapper.
Great job BTW!
Currently only a basic test is provided for this functionality. More extensive tests should be written to test all of the parameters
I am searching for a TV show by Title, then I select a show and search it by the ID it returned. For some shows this works just fine, but for others it doesn't.
For example, if I search for Game of Thrones I get the ID 1399. And when I search it by this ID I just get the error "Input string was not in a correct format."
This only happens with certain shows. Other shows like Lost and Friends work fine. By doing it manually with TMDB API, Game of Thrones returns the correct information, so I can't figure out if it is a problem with my code or this wrapper.
I must say that this is the only issue I've been having, everything has worked like a charm and that is if this is not my mistake! Thanks
Interpret the errors that TMDb produces, and handle them accordingly.
Possibly throw exceptions (and implement Try- methods for 'performance').
When one calls client.GetTvShow and one looks at the Seasons and Seasons.Episodes properties, it'll all nulls. As in I see 10 season objects, but full of nulls.
should it get and automatically populate those?
Token / Guest Session
Expire at should be UTC (always work in UTC - much easier for everyone)
Tests expecting exceptions
Always assert fail. Otherwise if no exception is thrown, the test succeeds. (already done)
Read Actions
Write Actions
Add an automatic request throttling setting and if not enabled throw an exception the utilizing application can use to manange it themself
.
ref:http://www.themoviedb.org/talk/5317af69c3a3685c4a0003b1
Hi
I'm trying to search the movies by NAME using ;
SearchContainer results = client.SearchMovie("movie name");
however when I check the returned result, I couldn't seem to find the "movie overview".
On the other hand if I search it by "id", Movie class has the "movie overview" and a lot more.
Movie movie = client.GetMovie(ID);
string test = movie.overview;
The only solution I found is making 2 different requests one for getting the id and than using the GetMovie method to retrieve the "movie overview"
SearchContainer results = client.SearchMovie(TextBox.Text);
foreach (SearchMovie result in results.Results)
{
int ID = result.Id;
Movie movie = client.GetMovie(ID);
}
Am I missing something or is this the way it should be?
Thanks
When using this library retrieved from NUGET yesterday I found that when constructing the library with an http:// in the URL parameter that it allowed this, however when calling the getConfig with this parameter the call failed.
The root cause was that I had prepended http:// to my URL parameter.
My suggestion is to add parameter verification to the base url parameter. The API Key cannot be verified easily because the TBDB might change their api keys one day and then the verification would be broken, but the URL parameter could be verified so as to prevent the module from crashing out with an error that would not lead easily to finding the issue.
Thanks for a great library. I have only literally scratched the surface. I was writing my own library when I decided to have a go at using this one. Having tried the WAT library and not really being impressed I did not have high hopes, but so far I have to say I am pleased. Of course, I have only made two calls to the library... :) ...
Based on the following comment in the forums we could add something that wraps this functionality.
Is it possible to fetch all episodes with a single query?
If I understand correctly, currently /3/tv/:id returns only the available season numbers, and I'd have to send a request for each season to /3/tv/:id/season/:num in order to fetch all episodes. This would be
undesirable in some cases, where there are just way too many seasons.Thank you for your response in advance.
EDIT: Nevermind, I've figured it out. Solution in case anyone else is bothered by this: /3/tv/:id?api_key=:key&append_to_response=season/1,season/2[,etc]
Hi,
I am building my first Windows 8 Metro App. I have just tried to add the NuGet-Package. Those wont work tho. It works fine for any other application type, but on metro i get the following error:
RestSharp 104.1 couldn´t be installed. No assembly information for .NETCore, Version=v.4.5
Do you have any idea how to fix this?
Greets
TestSearchCollection
TestSearchPerson
TestSearchList
TestSearchCompany
TestSearchKeyword
While GetTvShow and GetTvSeason are perfectly fine, GetTvEpisode is not returning any images when passing TvEpisodeMethods.Images as argument.
Corresponding API Page: http://docs.themoviedb.apiary.io/#reference/tv-episodes/tvidseasonseasonnumberepisodeepisodenumber
I think the problem is that the API response contains only a "stills" key for the images and no "backdrops" and "posters" keys.
TMdb 0.7.7 (nuget)
We might need a TvSeasonLight
object which only contains the information given by the GetTvShow()
call. The only information given is: AirDate
, Season
and PosterPath
.
The GetTvSeason()
method returns a TvSeason
object, which contains all the fields populated (as the API provides the data).
See #42 for core issue.
Class TMDbClientMovies.cs
the line : if (resp.Data.Trailers != null) has a exception
position of this line:
// Patch up data, so that the end user won't notice that we share objects between request-types.
if (resp.Data.Trailers != null)
resp.Data.Trailers.Id = resp.Data.Id;
Observation : resp.Data is null
First of all let me thank you for all the great software you have made available to the general public! It is much appreciated! I am sorry to bother you but theMovieDb just pushed out a new URL that broke the TMDbLib.dll that you created and as I am not a C# programmer not sure where to start to fix. Do you have any plans to update or is there a possibility that you could send me a ‘patch’ or fix? This is for a program for my personal use and not commercial.
Any help here would be appreciated. I have developed a workaround but it is far from ‘perfect’
Thanking you in advance!!
Regards,
danielvelasquez commented 3 days ago
Hello, I can't seem to use the Discover functionality, am I missing something? there is no Discover method in the client class...
Naliath
Collaborator
Naliath commented 3 days ago
Please use the source from here, the nuget package is out of date and will not be updated until the movie db tvshow api comes out of beta
danielvelasquez
danielvelasquez commented 2 days ago
Thanks, now I got the extra methods:) Although I found a small error there, when trying to sort by release date the argument taken by the DiscoverMovies method is a DiscoverTvShowSortBy Enum instead of DiscoverMovieSortBy.
Do you have support for TV episodes and serial on TMBD? If not any plans to support them?
Movie item1 = client.GetMovie("tt1979320", MovieMethods.SimilarMovies);
Movie item2 = client.GetMovie(96721, MovieMethods.SimilarMovies);
The above code will have the SimilarMovies property populated when using TMDb Id's, but not while using IMDB Id's
FYI: TestApplication.Program has someone's API key embedded. Not sure if you meant to expose this key to the public or not.
Also add related method on movies
Could you please tell us, how we can get the results from themoviedb.org in other languages then english?
Maybe I am missing something, but I think we are missing /tv/{id}/content_ratings.
I ultimately want the tv shows rating (ex. TV-MA)
Do we need another MovieMethod?
Thank you for your work!
getting the following error with request
model.Person = MovieDataClient.GetPerson(18918, extraMethods:
Enum.GetValues(typeof (PersonMethods))
.OfType()
.Aggregate((methods, personMethods) => personMethods | methods));
--------------STACK --------------------------
at TMDbLib.TMDbRestClient.Execute[T](IRestRequest request) in c:\tfs\PrimeMovies\TMDbLib\TMDbRestClient.cs:line 55
at RestSharp.RestClientExtensions.Get[T](IRestClient client, IRestRequest request)
at TMDbLib.Client.TMDbClient.GetPerson(Int32 id, PersonMethods extraMethods) in c:\tfs\PrimeMovies\TMDbLib\Client\TMDbClientPeople.cs:line 30
at PrimeMoviesWebUI.Controllers.HomeController.PersonDetail(Int32 id) in c:\tfs\PrimeMovies\PrimeMoviesWebUI\Controllers\HomeController.cs:line 80
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeSynchronousActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8
1.b__7(IAsyncResult _)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.b__33()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49()
Use:
var tvshow = client.GetTvShow(1399);
to replicate.
I haven't determined which property it is that's causing it, but it's an integer (stacktrace mentions Convert.ToInt32).
Could you please check, why you return the value #12:00:00 AM# as Object.Movies.Movie.Releasedate if this date is not available?
You can try with this TMDB-ID: 76162 or Original-Title "Stephen Fry In America - New World"
TestCollectionsExtrasNone
TestCompaniesExtrasNone
TestMoviesExtrasNone
TestPersonsExtrasNone
I love the fact that you have a get imageurl option which is helpful (again the lack of documentation what options to pass to size made me go back to imdb), but the first I ran into an exception and tehn realized after trying to debug it that I needed to call GetConfig.
Now my question - why should I have to call GetConfig? Logically when I create a new client it should automatically call get config right? there' nothing special about the parameters here.
When I try to compile the project using the nuget downloaded reference assembly I get an error saying referenced assembly does not have a strong name. I don't face this issue with other nuget reference assemblies I download
Could you please provide an example howto get a picture from TMDb?
I get back an example value like "/6z0X6AAebEx4SOMikbqHvenFUN2.jpg" for PosterPath, but how can I create the needed full path to download this picture?
These both require the newly implemented session id's
Hi !
In the last release, apparently the RestSharp dependency does not specify which version to use. RestSharp was updated, and therefore I have an error :
Could not load file or assembly 'RestSharp, Version=104.4.0.0, Culture=neutral, PublicKeyToken=null'
I would recomment either to specify the verison in the nuspec file, or setting the "Specific version" settings to false
Regards,
Hio,
Nice implementation of the API, I'm just porting my application over from V2 to your V3 implementation.
Could you possibly add an extra overload to the GetMovie method allowing us to provide a string (imdbID)?
It works exactly like the existing GetMovie method call, the API is smart enough to see that you are providing an imdb id and not an internal id.
Thanks!
imdb call example: http://api.themoviedb.org/3/movie/tt0105236?api_key=###
same call with internal id: http://api.themoviedb.org/3/movie/500?api_key=###
Hi,
As I say, It would be great to retrieve image from Uri.
If you want I can help you. I can make a pull request and if it's good for you, you can integrate my job to yours.
I will make Unit Test of course.
Thank you,
the origin of the error in the case of research the movie Avatar (Id: 19995) is due to the large value of the field "revenue" (in the response), Your class define an int, and the int value exceeds. A long type, is a solution.
Here is some lines of the Json file returned by the req:
{
"adult": false,
"backdrop_path": "/5XPPB44RQGfkBrbJxmtdndKz05n.jpg",
"belongs_to_collection": {
"id": 87096,
"name": "Avatar Collection",
"poster_path": "/oexAr649CHHdS0akKEDiHQT1qIk.jpg",
"backdrop_path": null
},
"budget": 237000000,
"genres": [
{
"id": 28,
"name": "Action"
},
{
"id": 12,
"name": "Aventure"
},
{
"id": 14,
"name": "Fantastique"
},
{
"id": 878,
"name": "Science-Fiction"
}
],
"homepage": "",
"id": 19995,
"imdb_id": "tt0499549",
"original_title": "Avatar",
"overview": "............................................................",
"popularity": 38499434.905,
"poster_path": "/nzN40Eck9q6YbdaNQs4pZbMKsfP.jpg",
"production_companies": [
{
"name": "20th Century Fox",
"id": 25
},
{
"name": "Dune Entertainment",
"id": 444
},
{
"name": "Ingenious Film Partners",
"id": 289
},
{
"name": "Lightstorm Entertainment",
"id": 574}
],
"production_countries": [
{"iso_3166_1": "US",
"name": "United States of America"},
{"iso_3166_1": "GB",
"name": "United Kingdom" }
],
"release_date": "2009-12-15",
"revenue": 2 781 505 847, <-------------------------------------------------
"runtime": 166,
Congratulations and thank you for your work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.