Soporte de The Movie Database

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 respuestas (en la página 1 de 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.

¿No encuentras una película o serie? Inicia sesión para crearla:

Global

s centrar la barra de búsqueda
p abrir menú de perfil
esc cierra una ventana abierta
? abrir la ventana de atajos del teclado

En las páginas multimedia

b retrocede (o a padre cuando sea aplicable)
e ir a la página de edición

En las páginas de temporada de televisión

(flecha derecha) ir a la temporada siguiente
(flecha izquierda) ir a la temporada anterior

En las páginas de episodio de televisión

(flecha derecha) ir al episodio siguiente
(flecha izquierda) ir al episodio anterior

En todas las páginas de imágenes

a abrir la ventana de añadir imagen

En todas las páginas de edición

t abrir la sección de traducción
ctrl+ s enviar formulario

En las páginas de discusión

n crear nueva discusión
w cambiar el estado de visualización
p cambiar público/privado
c cambiar cerrar/abrir
a abrir actividad
r responder a la discusión
l ir a la última respuesta
ctrl+ enter enviar tu mensaje
(flecha derecha) página siguiente
(flecha izquierda) página anterior

Configuraciones

¿Quieres puntuar o añadir este elemento a una lista?

Iniciar sesión