Show / Hide Table of Contents

Class OmdbService

Inheritance
System.Object
OmdbService
Namespace: CommonBotLibrary.Services
Assembly: cs.temp.dll.dll
Syntax
public class OmdbService : IMediaService, ISearchable<MediaBase>

Constructors

OmdbService(String)

Constructs an implementation that searches OMDb.

Declaration
public OmdbService(string apiKey = null)
Parameters
Type Name Description
System.String apiKey

Defaults to API key in Tokens if null.

Methods

DirectAsync(String, Type, Nullable<Int32>)

Retrieves a direct result from omdbapi.com with complete information.

Declaration
public Task<OmdbDirectResult> DirectAsync(string title, Type type = null, int ? year = null)
Parameters
Type Name Description
System.String title

The title to use.

Type type

The type of content to search for.

System.Nullable<System.Int32> year

The year the media was released.

Returns
Type Description
Task<OmdbDirectResult>

The most relevant media for the given title.

See Also
API TOS

SearchAsync(String, Type, Nullable<Int32>, String)

Searches omdbapi.com for media that match a given title.

Declaration
public Task<IEnumerable<OmdbSearchResult>> SearchAsync(string title, Type type = null, int ? year = null, string plot = "short")
Parameters
Type Name Description
System.String title

The title to search for.

Type type

The type of content to search for.

System.Nullable<System.Int32> year

The year the media was released.

System.String plot

The length of the returned plot summary; "short" or "full"

Returns
Type Description
Task<IEnumerable<OmdbSearchResult>>

A collection of relevant media filled with basic info.

See Also
API TOS
Back to top © 2017 - Borja Canseco