|
|
@ -54,7 +54,6 @@ namespace NzbDrone.Api.Movies
|
|
|
|
|
|
|
|
|
|
|
|
GetResourceAll = AllMovie;
|
|
|
|
GetResourceAll = AllMovie;
|
|
|
|
GetResourceById = GetMovie;
|
|
|
|
GetResourceById = GetMovie;
|
|
|
|
Get(TITLE_SLUG_ROUTE, GetByTitleSlug);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateResource = AddMovie;
|
|
|
|
CreateResource = AddMovie;
|
|
|
|
UpdateResource = UpdateMovie;
|
|
|
|
UpdateResource = UpdateMovie;
|
|
|
@ -106,29 +105,6 @@ namespace NzbDrone.Api.Movies
|
|
|
|
return moviesResources;
|
|
|
|
return moviesResources;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private object GetByTitleSlug(dynamic options)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string slug;
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
slug = options.slug;
|
|
|
|
|
|
|
|
// do stuff with x
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (RuntimeBinderException)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new NotFoundResponse();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return ResponseWithCode(MapToResource(_moviesService.FindByTitleSlug(slug)), HttpStatusCode.OK);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (ModelNotFoundException)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new NotFoundResponse();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int AddMovie(MovieResource moviesResource)
|
|
|
|
private int AddMovie(MovieResource moviesResource)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var model = moviesResource.ToModel();
|
|
|
|
var model = moviesResource.ToModel();
|
|
|
|