C# Класс Popcorn.Services.Movie.MovieService

Services used to interact with movies
Наследование: IMovieService
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
GetMoviesListFromWrapper IEnumerable

Открытые методы

Метод Описание
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, ...)

Приватные методы

Метод Описание
GetMoviesListFromWrapper ( Popcorn.Models.Movie.Short.WrapperMovieShort wrapper ) : IEnumerable

Get movies as a list from wrapped movies

Описание методов

ChangeTmdbLanguage() публичный Метод

Change the culture of TMDb
public ChangeTmdbLanguage ( ILanguage language ) : void
language ILanguage Language to set
Результат void

DownloadBackgroundImageAsync() публичный Метод

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
Результат Task

DownloadCastImageAsync() публичный Метод

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
Результат Task

DownloadCoverImageAsync() публичный Метод

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
Результат Task

DownloadPosterImageAsync() публичный Метод

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
Результат Task

DownloadSubtitleAsync() публичный Метод

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
Результат Task

GetGenresAsync() публичный Метод

Get all movie's genres
public GetGenresAsync ( CancellationToken ct ) : Task>
ct System.Threading.CancellationToken Used to cancel loading genres
Результат Task>

GetGreatestMoviesAsync() публичный Метод

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
Результат int>>.Task

GetMovieFullDetailsAsync() публичный Метод

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
Результат Task

GetMovieTrailerAsync() публичный Метод

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
Результат Task>

GetPopularMoviesAsync() публичный Метод

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
Результат int>>.Task

GetRecentMoviesAsync() публичный Метод

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
Результат int>>.Task

LoadSubtitlesAsync() публичный Метод

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
Результат Task

MovieService() публичный Метод

Initialize a new instance of MovieService class
public MovieService ( ) : System
Результат System

SearchMoviesAsync() публичный Метод

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
Результат int>>.Task

TranslateMovieFullAsync() публичный Метод

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
Результат Task

TranslateMovieShortAsync() публичный Метод

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
Результат Task