Assistance de TMDB

I have a winform application (school project) that I want to display a movies description in. I just need to put in the movie name and get back a string with the description yet I can't seem to find a method that does this.

What am I missing and how do I accomplish this?

I'm usiing TMDbLib:

string APIKey = "MyKey";

            TMDbClient client = new TMDbClient(APIKey);
            SearchContainer<SearchMovie> results = client.SearchMovieAsync("007").Result;

            Movie movie = ???


            Console.WriteLine();

Thank you, -Rob

4 réponses (sur la page 1 sur 1)

Jump to last post

Hi Rob,

I can't help you with any specific code but a movie search will return an array object called results. You should iterate over that array for each result. Each result object contains an overview object which is what you're looking for. You can see what those responses look like in the documentation I just linked to.

"I can't help you with any specific code"

As it turns out, neither can the creator of the library I'm using. I emailed them and this was the response:

"You would want to look at searching then. Possibly even the Discovery method calls"

Everyone wants to write software, but nobody wants to tell people how to use it. I've looked at three libraries that have maybe 20 lines of documentation each.

Sorry, rant over.

Thank you Travis.

Assuming you're writing C# (I'm assuming you are since yo mentioned the TMDbLib lib) this library here, has some examples near the bottom of his readme that outlines a search and get results. That might be useful.

I've never written a single line of C# in my life so unfortunately, I can't contribute much beyond linking to some docs.

P.S. based on LordMike's GitHub page, which I didn't see before, he has a similar example.

TMDbClient client = new TMDbClient("APIKey");
SearchContainer<SearchMovie> results = client.SearchMovieAsync("007").Result;

Console.WriteLine($"Got {results.Results.Count:N0} of {results.TotalResults:N0} results");
foreach (SearchMovie result in results.Results)
    Console.WriteLine(result.Title);

That example is iterating over the results array, and writing the title to the console. Use Console.WriteLine(result.Overview); to get the overview.

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion