|
|
@ -1,14 +1,11 @@
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Ombi.Api.Lidarr.Models;
|
|
|
|
|
|
|
|
using Ombi.Core;
|
|
|
|
using Ombi.Core;
|
|
|
|
using Ombi.Core.Engine;
|
|
|
|
using Ombi.Core.Engine;
|
|
|
|
using Ombi.Core.Engine.Interfaces;
|
|
|
|
using Ombi.Core.Engine.Interfaces;
|
|
|
|
using Ombi.Core.Models;
|
|
|
|
|
|
|
|
using Ombi.Core.Models.Search;
|
|
|
|
using Ombi.Core.Models.Search;
|
|
|
|
using Ombi.Models;
|
|
|
|
using Ombi.Models;
|
|
|
|
using StackExchange.Profiling;
|
|
|
|
using StackExchange.Profiling;
|
|
|
@ -42,6 +39,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <param name="searchTerm">The search term.</param>
|
|
|
|
/// <param name="searchTerm">The search term.</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("movie/{searchTerm}")]
|
|
|
|
[HttpGet("movie/{searchTerm}")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> SearchMovie(string searchTerm)
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> SearchMovie(string searchTerm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using (MiniProfiler.Current.Step("SearchingMovie"))
|
|
|
|
using (MiniProfiler.Current.Step("SearchingMovie"))
|
|
|
@ -56,7 +55,7 @@ namespace Ombi.Controllers
|
|
|
|
/// Searches for a movie.
|
|
|
|
/// Searches for a movie.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
/// <param name="model">The refinement model, language code and year are both optional</param>
|
|
|
|
/// <param name="model">The refinement model, language code and year are both optional. Language code uses ISO 639-1</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("movie")]
|
|
|
|
[HttpPost("movie")]
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
@ -86,11 +85,35 @@ namespace Ombi.Controllers
|
|
|
|
/// We use TheMovieDb as the Movie Provider
|
|
|
|
/// We use TheMovieDb as the Movie Provider
|
|
|
|
/// </remarks>
|
|
|
|
/// </remarks>
|
|
|
|
[HttpGet("movie/info/{theMovieDbId}")]
|
|
|
|
[HttpGet("movie/info/{theMovieDbId}")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<SearchMovieViewModel> GetExtraMovieInfo(int theMovieDbId)
|
|
|
|
public async Task<SearchMovieViewModel> GetExtraMovieInfo(int theMovieDbId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await MovieEngine.LookupImdbInformation(theMovieDbId);
|
|
|
|
return await MovieEngine.LookupImdbInformation(theMovieDbId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets extra information on the movie e.g. IMDBId
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="model">TheMovieDb and Language Code, Pass in the language code (ISO 639-1) to get it back in a different lang </param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
|
|
/// We use TheMovieDb as the Movie Provider
|
|
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[HttpPost("movie/info")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
|
|
|
|
public async Task<IActionResult> GetExtraMovieInfo([FromBody] SearchMovieExtraInfoRefineModel model)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (model == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return BadRequest();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Json(await MovieEngine.LookupImdbInformation(model.TheMovieDbId, model.LanguageCode));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Returns similar movies to the movie id passed in
|
|
|
|
/// Returns similar movies to the movie id passed in
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -99,6 +122,8 @@ namespace Ombi.Controllers
|
|
|
|
/// We use TheMovieDb as the Movie Provider
|
|
|
|
/// We use TheMovieDb as the Movie Provider
|
|
|
|
/// </remarks>
|
|
|
|
/// </remarks>
|
|
|
|
[HttpGet("movie/{theMovieDbId}/similar")]
|
|
|
|
[HttpGet("movie/{theMovieDbId}/similar")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> SimilarMovies(int theMovieDbId)
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> SimilarMovies(int theMovieDbId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await MovieEngine.SimilarMovies(theMovieDbId);
|
|
|
|
return await MovieEngine.SimilarMovies(theMovieDbId);
|
|
|
@ -110,6 +135,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("movie/popular")]
|
|
|
|
[HttpGet("movie/popular")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> Popular()
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> Popular()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await MovieEngine.PopularMovies();
|
|
|
|
return await MovieEngine.PopularMovies();
|
|
|
@ -120,6 +147,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("movie/nowplaying")]
|
|
|
|
[HttpGet("movie/nowplaying")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> NowPlayingMovies()
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> NowPlayingMovies()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await MovieEngine.NowPlayingMovies();
|
|
|
|
return await MovieEngine.NowPlayingMovies();
|
|
|
@ -130,6 +159,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
[HttpGet("movie/toprated")]
|
|
|
|
[HttpGet("movie/toprated")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> TopRatedMovies()
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> TopRatedMovies()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await MovieEngine.TopRatedMovies();
|
|
|
|
return await MovieEngine.TopRatedMovies();
|
|
|
@ -140,6 +171,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
/// <remarks>We use TheMovieDb as the Movie Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("movie/upcoming")]
|
|
|
|
[HttpGet("movie/upcoming")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> UpcomingMovies()
|
|
|
|
public async Task<IEnumerable<SearchMovieViewModel>> UpcomingMovies()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await MovieEngine.UpcomingMovies();
|
|
|
|
return await MovieEngine.UpcomingMovies();
|
|
|
@ -152,6 +185,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use TvMaze as the Provider</remarks>
|
|
|
|
/// <remarks>We use TvMaze as the Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("tv/{searchTerm}")]
|
|
|
|
[HttpGet("tv/{searchTerm}")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> SearchTv(string searchTerm)
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> SearchTv(string searchTerm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await TvEngine.Search(searchTerm);
|
|
|
|
return await TvEngine.Search(searchTerm);
|
|
|
@ -164,6 +199,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use TvMaze as the Provider</remarks>
|
|
|
|
/// <remarks>We use TvMaze as the Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("tv/info/{tvdbId}")]
|
|
|
|
[HttpGet("tv/info/{tvdbId}")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<SearchTvShowViewModel> GetShowInfo(int tvdbId)
|
|
|
|
public async Task<SearchTvShowViewModel> GetShowInfo(int tvdbId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await TvEngine.GetShowInformation(tvdbId);
|
|
|
|
return await TvEngine.GetShowInformation(tvdbId);
|
|
|
@ -175,6 +212,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use Trakt.tv as the Provider</remarks>
|
|
|
|
/// <remarks>We use Trakt.tv as the Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("tv/popular")]
|
|
|
|
[HttpGet("tv/popular")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> PopularTv()
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> PopularTv()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await TvEngine.Popular();
|
|
|
|
return await TvEngine.Popular();
|
|
|
@ -186,6 +225,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use Trakt.tv as the Provider</remarks>
|
|
|
|
/// <remarks>We use Trakt.tv as the Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("tv/anticipated")]
|
|
|
|
[HttpGet("tv/anticipated")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> AnticipatedTv()
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> AnticipatedTv()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await TvEngine.Anticipated();
|
|
|
|
return await TvEngine.Anticipated();
|
|
|
@ -198,6 +239,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use Trakt.tv as the Provider</remarks>
|
|
|
|
/// <remarks>We use Trakt.tv as the Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("tv/mostwatched")]
|
|
|
|
[HttpGet("tv/mostwatched")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> MostWatched()
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> MostWatched()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await TvEngine.MostWatches();
|
|
|
|
return await TvEngine.MostWatches();
|
|
|
@ -209,6 +252,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use Trakt.tv as the Provider</remarks>
|
|
|
|
/// <remarks>We use Trakt.tv as the Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("tv/trending")]
|
|
|
|
[HttpGet("tv/trending")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> Trending()
|
|
|
|
public async Task<IEnumerable<SearchTvShowViewModel>> Trending()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await TvEngine.Trending();
|
|
|
|
return await TvEngine.Trending();
|
|
|
@ -220,6 +265,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use Lidarr as the Provider</remarks>
|
|
|
|
/// <remarks>We use Lidarr as the Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("music/artist/{searchTerm}")]
|
|
|
|
[HttpGet("music/artist/{searchTerm}")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchArtistViewModel>> SearchArtist(string searchTerm)
|
|
|
|
public async Task<IEnumerable<SearchArtistViewModel>> SearchArtist(string searchTerm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await MusicEngine.SearchArtist(searchTerm);
|
|
|
|
return await MusicEngine.SearchArtist(searchTerm);
|
|
|
@ -231,6 +278,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use Lidarr as the Provider</remarks>
|
|
|
|
/// <remarks>We use Lidarr as the Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("music/album/{searchTerm}")]
|
|
|
|
[HttpGet("music/album/{searchTerm}")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchAlbumViewModel>> SearchAlbum(string searchTerm)
|
|
|
|
public async Task<IEnumerable<SearchAlbumViewModel>> SearchAlbum(string searchTerm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await MusicEngine.SearchAlbum(searchTerm);
|
|
|
|
return await MusicEngine.SearchAlbum(searchTerm);
|
|
|
@ -242,6 +291,8 @@ namespace Ombi.Controllers
|
|
|
|
/// <remarks>We use Lidarr as the Provider</remarks>
|
|
|
|
/// <remarks>We use Lidarr as the Provider</remarks>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("music/artist/album/{foreignArtistId}")]
|
|
|
|
[HttpGet("music/artist/album/{foreignArtistId}")]
|
|
|
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
|
public async Task<IEnumerable<SearchAlbumViewModel>> GetAlbumsByArtist(string foreignArtistId)
|
|
|
|
public async Task<IEnumerable<SearchAlbumViewModel>> GetAlbumsByArtist(string foreignArtistId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await MusicEngine.GetArtistAlbums(foreignArtistId);
|
|
|
|
return await MusicEngine.GetArtistAlbums(foreignArtistId);
|
|
|
|