C# Class Popcorn.Services.Movie.MovieService

Services used to interact with movies
Inheritance: IMovieService
显示文件 Open project: bbougot/Popcorn Class Usage Examples

Private Properties

Property Type Description
GetMoviesListFromWrapper IEnumerable

Public Methods

Method Description
ChangeTmdbLanguage ( ILanguage language ) : void

Change the culture of TMDb

DownloadBackgroundImageAsync ( MovieFull movie, CancellationTokenSource ct ) : Task

Download the movie's background image

DownloadCastImageAsync ( MovieFull movie, CancellationTokenSource ct ) : Task

Download actors' image for a movie

DownloadCoverImageAsync ( IEnumerable movies, CancellationTokenSource ct ) : Task

Download cover image for each of the movies provided

DownloadPosterImageAsync ( MovieFull movie, CancellationTokenSource ct ) : Task

Download the movie's poster image

DownloadSubtitleAsync ( MovieFull movie, IProgress progress, CancellationTokenSource ct ) : Task

Download a subtitle

GetGenresAsync ( CancellationToken ct ) : Task>

Get all movie's genres

GetGreatestMoviesAsync ( int page, int limit, double ratingFilter, CancellationToken ct, Popcorn.Models.Genre.MovieGenre genre = null ) : int>>.Task

Get greatest movies by page

GetMovieFullDetailsAsync ( Popcorn.Models.Movie.Short.MovieShort movieToLoad, CancellationToken ct ) : Task

Get TMDb movie informations

GetMovieTrailerAsync ( MovieFull movie, CancellationToken ct ) : Task>

Get the link to the youtube trailer of a movie

GetPopularMoviesAsync ( int page, int limit, double ratingFilter, CancellationToken ct, Popcorn.Models.Genre.MovieGenre genre = null ) : int>>.Task

Get popular movies by page

GetRecentMoviesAsync ( int page, int limit, double ratingFilter, CancellationToken ct, Popcorn.Models.Genre.MovieGenre genre = null ) : int>>.Task

Get recent movies by page

LoadSubtitlesAsync ( MovieFull movie, CancellationToken ct ) : Task

Get the movie's subtitles according to a language

MovieService ( ) : System

Initialize a new instance of MovieService class

SearchMoviesAsync ( string criteria, int page, int limit, Popcorn.Models.Genre.MovieGenre genre, double ratingFilter, CancellationToken ct ) : int>>.Task

Search movies by criteria

TranslateMovieFullAsync ( MovieFull movieToTranslate, CancellationToken ct ) : Task

Translate movie informations (title, description, ...)

TranslateMovieShortAsync ( Popcorn.Models.Movie.Short.MovieShort movieToTranslate, CancellationToken ct ) : Task

Translate movie informations (title, description, ...)

Private Methods

Method Description
GetMoviesListFromWrapper ( Popcorn.Models.Movie.Short.WrapperMovieShort wrapper ) : IEnumerable

Get movies as a list from wrapped movies

Method Details

ChangeTmdbLanguage() public method

Change the culture of TMDb
public ChangeTmdbLanguage ( ILanguage language ) : void
language ILanguage Language to set
return void

DownloadBackgroundImageAsync() public method

Download the movie's background image
public DownloadBackgroundImageAsync ( MovieFull movie, CancellationTokenSource ct ) : Task
movie Popcorn.Models.Movie.Full.MovieFull The movie to process
ct System.Threading.CancellationTokenSource Used to cancel downloading background image
return Task

DownloadCastImageAsync() public method

Download actors' image for a movie
public DownloadCastImageAsync ( MovieFull movie, CancellationTokenSource ct ) : Task
movie Popcorn.Models.Movie.Full.MovieFull The movie to process
ct System.Threading.CancellationTokenSource Used to cancel downloading actor image
return Task

DownloadCoverImageAsync() public method

Download cover image for each of the movies provided
public DownloadCoverImageAsync ( IEnumerable movies, CancellationTokenSource ct ) : Task
movies IEnumerable The movies to process
ct System.Threading.CancellationTokenSource Used to cancel task
return Task

DownloadPosterImageAsync() public method

Download the movie's poster image
public DownloadPosterImageAsync ( MovieFull movie, CancellationTokenSource ct ) : Task
movie Popcorn.Models.Movie.Full.MovieFull The movie to process
ct System.Threading.CancellationTokenSource Used to cancel downloading poster image
return Task

DownloadSubtitleAsync() public method

Download a subtitle
public DownloadSubtitleAsync ( MovieFull movie, IProgress progress, CancellationTokenSource ct ) : Task
movie Popcorn.Models.Movie.Full.MovieFull The movie of which to retrieve its subtitles
progress IProgress Report the progress of the download
ct System.Threading.CancellationTokenSource Cancellation token
return Task

GetGenresAsync() public method

Get all movie's genres
public GetGenresAsync ( CancellationToken ct ) : Task>
ct System.Threading.CancellationToken Used to cancel loading genres
return Task>

GetGreatestMoviesAsync() public method

Get greatest movies by page
public GetGreatestMoviesAsync ( int page, int limit, double ratingFilter, CancellationToken ct, Popcorn.Models.Genre.MovieGenre genre = null ) : int>>.Task
page int Page to return
limit int The maximum number of movies to return
ratingFilter double Used to filter by rating
ct System.Threading.CancellationToken Cancellation token
genre Popcorn.Models.Genre.MovieGenre The genre to filter
return int>>.Task

GetMovieFullDetailsAsync() public method

Get TMDb movie informations
public GetMovieFullDetailsAsync ( Popcorn.Models.Movie.Short.MovieShort movieToLoad, CancellationToken ct ) : Task
movieToLoad Popcorn.Models.Movie.Short.MovieShort Movie to load
ct System.Threading.CancellationToken Used to cancel loading
return Task

GetMovieTrailerAsync() public method

Get the link to the youtube trailer of a movie
public GetMovieTrailerAsync ( MovieFull movie, CancellationToken ct ) : Task>
movie Popcorn.Models.Movie.Full.MovieFull The movie
ct System.Threading.CancellationToken Used to cancel loading trailer
return Task>

GetPopularMoviesAsync() public method

Get popular movies by page
public GetPopularMoviesAsync ( int page, int limit, double ratingFilter, CancellationToken ct, Popcorn.Models.Genre.MovieGenre genre = null ) : int>>.Task
page int Page to return
limit int The maximum number of movies to return
ratingFilter double Used to filter by rating
ct System.Threading.CancellationToken Cancellation token
genre Popcorn.Models.Genre.MovieGenre The genre to filter
return int>>.Task

GetRecentMoviesAsync() public method

Get recent movies by page
public GetRecentMoviesAsync ( int page, int limit, double ratingFilter, CancellationToken ct, Popcorn.Models.Genre.MovieGenre genre = null ) : int>>.Task
page int Page to return
limit int The maximum number of movies to return
ratingFilter double Used to filter by rating
ct System.Threading.CancellationToken Cancellation token
genre Popcorn.Models.Genre.MovieGenre The genre to filter
return int>>.Task

LoadSubtitlesAsync() public method

Get the movie's subtitles according to a language
public LoadSubtitlesAsync ( MovieFull movie, CancellationToken ct ) : Task
movie Popcorn.Models.Movie.Full.MovieFull The movie of which to retrieve its subtitles
ct System.Threading.CancellationToken Cancellation token
return Task

MovieService() public method

Initialize a new instance of MovieService class
public MovieService ( ) : System
return System

SearchMoviesAsync() public method

Search movies by criteria
public SearchMoviesAsync ( string criteria, int page, int limit, Popcorn.Models.Genre.MovieGenre genre, double ratingFilter, CancellationToken ct ) : int>>.Task
criteria string Criteria used for search
page int Page to return
limit int The maximum number of movies to return
genre Popcorn.Models.Genre.MovieGenre The genre to filter
ratingFilter double Used to filter by rating
ct System.Threading.CancellationToken Cancellation token
return int>>.Task

TranslateMovieFullAsync() public method

Translate movie informations (title, description, ...)
public TranslateMovieFullAsync ( MovieFull movieToTranslate, CancellationToken ct ) : Task
movieToTranslate Popcorn.Models.Movie.Full.MovieFull Movie to translate
ct System.Threading.CancellationToken Used to cancel translation
return Task

TranslateMovieShortAsync() public method

Translate movie informations (title, description, ...)
public TranslateMovieShortAsync ( Popcorn.Models.Movie.Short.MovieShort movieToTranslate, CancellationToken ct ) : Task
movieToTranslate Popcorn.Models.Movie.Short.MovieShort Movie to translate
ct System.Threading.CancellationToken Used to cancel translation
return Task