C# Class Popcorn.Services.Movie.MovieService

Services used to interact with movies
Inheritance: IMovieService
Afficher le fichier Open project: bbougot/Popcorn Class Usage Examples

Private Properties

Свойство Type Description
GetMoviesListFromWrapper IEnumerable

Méthodes publiques

Méthode 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

Méthode Description
GetMoviesListFromWrapper ( Popcorn.Models.Movie.Short.WrapperMovieShort wrapper ) : IEnumerable

Get movies as a list from wrapped movies

Method Details

ChangeTmdbLanguage() public méthode

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

DownloadBackgroundImageAsync() public méthode

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
Résultat Task

DownloadCastImageAsync() public méthode

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
Résultat Task

DownloadCoverImageAsync() public méthode

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
Résultat Task

DownloadPosterImageAsync() public méthode

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
Résultat Task

DownloadSubtitleAsync() public méthode

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
Résultat Task

GetGenresAsync() public méthode

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

GetGreatestMoviesAsync() public méthode

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
Résultat int>>.Task

GetMovieFullDetailsAsync() public méthode

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
Résultat Task

GetMovieTrailerAsync() public méthode

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
Résultat Task>

GetPopularMoviesAsync() public méthode

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
Résultat int>>.Task

GetRecentMoviesAsync() public méthode

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
Résultat int>>.Task

LoadSubtitlesAsync() public méthode

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
Résultat Task

MovieService() public méthode

Initialize a new instance of MovieService class
public MovieService ( ) : System
Résultat System

SearchMoviesAsync() public méthode

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
Résultat int>>.Task

TranslateMovieFullAsync() public méthode

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
Résultat Task

TranslateMovieShortAsync() public méthode

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
Résultat Task