Reverted TMDB package

pull/609/head
Jamie.Rees 8 years ago
parent 098790dcab
commit 39955f1cad

@ -62,8 +62,8 @@
<Reference Include="Nancy, Version=1.4.2.0, Culture=neutral, PublicKeyToken=null"> <Reference Include="Nancy, Version=1.4.2.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Nancy.1.4.3\lib\net40\Nancy.dll</HintPath> <HintPath>..\packages\Nancy.1.4.3\lib\net40\Nancy.dll</HintPath>
</Reference> </Reference>
<Reference Include="TMDbLib, Version=0.9.6.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="TMDbLib, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TMDbLib.0.9.6.0-alpha\lib\net45\TMDbLib.dll</HintPath> <HintPath>..\packages\TMDbLib.0.9.0.0-alpha\lib\net45\TMDbLib.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>

@ -46,44 +46,44 @@ namespace PlexRequests.Api
public TMDbClient Client { get; set; } public TMDbClient Client { get; set; }
public async Task<List<SearchMovie>> SearchMovie(string searchTerm) public async Task<List<SearchMovie>> SearchMovie(string searchTerm)
{ {
var results = await Client.SearchMovieAsync(searchTerm); var results = await Client.SearchMovie(searchTerm);
return results.Results; return results.Results;
} }
[Obsolete("Should use TvMaze for TV")] [Obsolete("Should use TvMaze for TV")]
public async Task<List<SearchTv>> SearchTv(string searchTerm) public async Task<List<SearchTv>> SearchTv(string searchTerm)
{ {
var results = await Client.SearchTvShowAsync(searchTerm); var results = await Client.SearchTvShow(searchTerm);
return results.Results; return results.Results;
} }
public async Task<List<SearchMovie>> GetCurrentPlayingMovies() public async Task<List<MovieResult>> GetCurrentPlayingMovies()
{ {
var movies = await Client.GetMovieNowPlayingListAsync(); var movies = await Client.GetMovieList(MovieListType.NowPlaying);
return movies.Results; return movies.Results;
} }
public async Task<List<SearchMovie>> GetUpcomingMovies() public async Task<List<MovieResult>> GetUpcomingMovies()
{ {
var movies = await Client.GetMovieUpcomingListAsync(); var movies = await Client.GetMovieList(MovieListType.Upcoming);
return movies.Results; return movies.Results;
} }
public async Task<Movie> GetMovieInformation(int tmdbId) public async Task<Movie> GetMovieInformation(int tmdbId)
{ {
var movies = await Client.GetMovieAsync(tmdbId); var movies = await Client.GetMovie(tmdbId);
return movies; return movies;
} }
public async Task<Movie> GetMovieInformation(string imdbId) public async Task<Movie> GetMovieInformation(string imdbId)
{ {
var movies = await Client.GetMovieAsync(imdbId); var movies = await Client.GetMovie(imdbId);
return movies; return movies;
} }
[Obsolete("Should use TvMaze for TV")] [Obsolete("Should use TvMaze for TV")]
public async Task<TvShow> GetTvShowInformation(int tmdbId) public async Task<TvShow> GetTvShowInformation(int tmdbId)
{ {
var show = await Client.GetTvShowAsync(tmdbId); var show = await Client.GetTvShow(tmdbId);
return show; return show;
} }
} }

@ -7,5 +7,5 @@
<package id="Polly-Signed" version="4.3.0" targetFramework="net45" /> <package id="Polly-Signed" version="4.3.0" targetFramework="net45" />
<package id="RestSharp" version="105.2.3" targetFramework="net45" /> <package id="RestSharp" version="105.2.3" targetFramework="net45" />
<package id="System.Net.Http" version="4.0.0" targetFramework="net45" /> <package id="System.Net.Http" version="4.0.0" targetFramework="net45" />
<package id="TMDbLib" version="0.9.6.0-alpha" targetFramework="net45" /> <package id="TMDbLib" version="0.9.0.0-alpha" targetFramework="net45" />
</packages> </packages>

@ -412,6 +412,8 @@ namespace PlexRequests.Services.Jobs
try try
{ {
// TODO what the fuck was I thinking
if (setCache) if (setCache)
{ {
results = GetLibraries(plexSettings); results = GetLibraries(plexSettings);

@ -184,14 +184,14 @@ namespace PlexRequests.UI.Modules
private async Task<Response> ProcessMovies(MovieSearchType searchType, string searchTerm) private async Task<Response> ProcessMovies(MovieSearchType searchType, string searchTerm)
{ {
List<SearchMovie> apiMovies; List<MovieResult> apiMovies;
switch (searchType) switch (searchType)
{ {
case MovieSearchType.Search: case MovieSearchType.Search:
var movies = await MovieApi.SearchMovie(searchTerm).ConfigureAwait(false); var movies = await MovieApi.SearchMovie(searchTerm).ConfigureAwait(false);
apiMovies = movies.Select(x => apiMovies = movies.Select(x =>
new SearchMovie new MovieResult
{ {
Adult = x.Adult, Adult = x.Adult,
BackdropPath = x.BackdropPath, BackdropPath = x.BackdropPath,
@ -217,7 +217,7 @@ namespace PlexRequests.UI.Modules
apiMovies = await MovieApi.GetUpcomingMovies(); apiMovies = await MovieApi.GetUpcomingMovies();
break; break;
default: default:
apiMovies = new List<SearchMovie>(); apiMovies = new List<MovieResult>();
break; break;
} }

@ -197,8 +197,8 @@
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll</HintPath> <HintPath>..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll</HintPath>
</Reference> </Reference>
<Reference Include="TMDbLib, Version=0.9.6.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="TMDbLib, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TMDbLib.0.9.6.0-alpha\lib\net45\TMDbLib.dll</HintPath> <HintPath>..\packages\TMDbLib.0.9.0.0-alpha\lib\net45\TMDbLib.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>

@ -51,5 +51,5 @@
<package id="System.Runtime" version="4.0.0" targetFramework="net45" /> <package id="System.Runtime" version="4.0.0" targetFramework="net45" />
<package id="System.Runtime.Extensions" version="4.0.0" targetFramework="net45" /> <package id="System.Runtime.Extensions" version="4.0.0" targetFramework="net45" />
<package id="System.Text.RegularExpressions" version="4.0.0" targetFramework="net45" /> <package id="System.Text.RegularExpressions" version="4.0.0" targetFramework="net45" />
<package id="TMDbLib" version="0.9.6.0-alpha" targetFramework="net45" /> <package id="TMDbLib" version="0.9.0.0-alpha" targetFramework="net45" />
</packages> </packages>
Loading…
Cancel
Save