miguelhasse / net.tmdb Goto Github PK
View Code? Open in Web Editor NEWClient library for accessing the TMDb API in .NET
License: MIT License
Client library for accessing the TMDb API in .NET
License: MIT License
I am doing an initial search for Movies with a search term ("Scorpion King" to be exact) and am getting no Status field value, just null. My app does not need to show Released movies in the search results. Do I have to get individual results to get the Status? Am I just supposed to figure it out with the Release Date value?
I have a solution with a Xamarin.iOS and a Xamarin.Android project. Both of them have a reference to Hasseware.Net.TMDb. The class that uses the .Net.TMDb library is in a shared project, which both the iOS and the Droid project also have a reference to.
This work fine in the iOS app, but when I run the Android app (whose functionality is identical to the iOS app), I do not get any response back when I call this function (or any other .Net.TMDb function, for that matter):
public async Task GetMoviesAsync(string query)
{
var movies = await this._client.Movies.SearchAsync(query, "en", true, null, true, 1, new CancellationToken());
return movies;
}
Any idea what can be the problem?
I ended up doing the request by hand
{
HttpClient client = new HttpClient();
Uri uri = new Uri(string.Format(Constants.RestUrl, "api_key=<APIKEY>&language=en-US&page=" + page));
try
{
string text = await client.GetStringAsync(uri, cancellationToken);
Console.WriteLine("Result Movie: " + text);
}
catch (HttpRequestException httpRequestException)
{
Console.WriteLine("Status code:" + httpRequestException.StatusCode);
throw;
}
}```
Hello,
I am currently looking to use your library. I have issue with the cancellationToken
.
I think I miss some skills with this object.
Can you provide a working sample to show how to use it ?
Thank you for your work.
OK, I think this one is for real. I am now getting back movies individually and getting all "sub-lists" populated and it appears that every runtime on every movie is populated with null.
In class SystemContext method GetAccountAsync takes the parameter session_id but not passes it to GetAsync.
Request has the form of "http://api.themoviedb.org/3/account?api_key=r4e3w2q1&" and needed to "http://api.themoviedb.org/3/account?api_key=r4e3w2q1&session_id=1q2w3e"
Is it possible to add the language to the genres request?
https://developers.themoviedb.org/3/genres
Hey, could you please provide a sample where the app searches for a movie title from a user string and then displays its rating?
I ask because I want to build a small solution that gets all movies from folder names, loads their title in a tree view and displays their ratings as child nodes in the tree, so that I can easily delete the ones with the lowest scores (its a huge collection!).
Thanks so much in advance!!!
Also, I'm having trouble with getting Casts. Is this supposed to work? I keep getting an "Object reference not set to an instance of an object." error.
List list = (await GetMovies()).Select(m => new MovieViewModel()
{
ID = m.Id,
ImdbID = m.Imdb,
Status = m.Status,
Title = m.Title,
Description = m.Overview,
Cast = m.Credits.Cast.Select(c => c.Name).ToList(),
ReleaseDate = m.ReleaseDate,
PosterPath = string.Format("https://image.tmdb.org/t/p/w185{0}", m.Poster),
//BackDropPath = string.Format("https://image.tmdb.org/t/p/w780{0}", m.Backdrop)
}).ToList();
Json.NET is a popular high-performance JSON framework for .NET
Library home page: https://api.nuget.org/packages/newtonsoft.json.6.0.6.nupkg
Path to dependency file: /Hasseware.Net.TMDb.csproj
Path to vulnerable library: /packages.config,/src/Net.TMDb.Portable/packages.config
Dependency Hierarchy:
Json.NET is a popular high-performance JSON framework for .NET
Library home page: https://api.nuget.org/packages/newtonsoft.json.10.0.3.nupkg
Path to dependency file: /.nuget/TheMovieDB.nuspec
Path to vulnerable library: /.nuget/TheMovieDB.nuspec
Dependency Hierarchy:
Found in base branch: master
Newtonsoft.Json prior to version 13.0.1 is vulnerable to Insecure Defaults due to improper handling of expressions with high nesting level that lead to StackOverFlow exception or high CPU and RAM usage. Exploiting this vulnerability results in Denial Of Service (DoS). \n\nThe serialization and deserialization path have different properties regarding the issue.\n\nDeserializing methods (like JsonConvert.DeserializeObject
) will process the input that results in burning the CPU, allocating memory, and consuming a thread of execution. Quite high nesting level (>10kk, or 9.5MB of {a:{a:{...
input) is needed to achieve the latency over 10 seconds, depending on the hardware.\n\nSerializing methods (like JsonConvert.Serialize
or JObject.ToString
) will throw StackOverFlow exception with the nesting level of around 20k.\n\nTo mitigate the issue one either need to update Newtonsoft.Json to 13.0.1 or set MaxDepth
parameter in the JsonSerializerSettings
. This can be done globally with the following statement. After that the parsing of the nested input will fail fast with Newtonsoft.Json.JsonReaderException
:\n\n \nJsonConvert.DefaultSettings = () => new JsonSerializerSettings { MaxDepth = 128 };\n
\n\nRepro code:\n\n//Create a string representation of an highly nested object (JSON serialized)\nint nRep = 25000;\nstring json = string.Concat(Enumerable.Repeat(\"{a:\", nRep)) + \"1\" +\n string.Concat(Enumerable.Repeat(\"}\", nRep));\n\n//Parse this object (leads to high CPU/RAM consumption)\nvar parsedJson = JsonConvert.DeserializeObject(json);\n\n// Methods below all throw stack overflow with nRep around 20k and higher\n// string a = parsedJson.ToString();\n// string b = JsonConvert.SerializeObject(parsedJson);\n
\n\n### Additional affected product and version information\nThe original statement about the problem only affecting IIS applications is misleading. Any application is affected, however the IIS has a behavior that stops restarting the instance after some time resulting in a harder-to-fix DoS.**
Publish Date: 2022-06-22
URL: WS-2022-0161
Base Score Metrics:
Type: Upgrade version
Release Date: 2022-06-22
Fix Resolution: Newtonsoft.Json - 13.0.1;Microsoft.Extensions.ApiDescription.Server - 6.0.0
Step up your Open Source Security Game with Mend here
I'm building a small home-brew project making use of your great library to interact with Tmdb. Firstly - thanks v much, it works great!
I wish to extend the models slightly to add/set some properties but with the 'internal' modifier I'm not able to. Just wondered if its absolutely necessary to have them like this or you could make them open and extendable models? Would make things a bit easier.
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.