Cleaned up some validation

pull/3113/head
Mark McDowall 11 years ago
parent a40ad82fa7
commit 5343bde070

@ -40,7 +40,7 @@ namespace NzbDrone.Api.Indexers
GetResourceAll = GetReleases; GetResourceAll = GetReleases;
Post["/"] = x=> DownloadRelease(this.Bind<ReleaseResource>()); Post["/"] = x=> DownloadRelease(this.Bind<ReleaseResource>());
PostValidator.RuleFor(s => s.DownloadAllowed); PostValidator.RuleFor(s => s.DownloadAllowed).Equal(true);
} }
private Response DownloadRelease(ReleaseResource release) private Response DownloadRelease(ReleaseResource release)

@ -29,7 +29,6 @@ namespace NzbDrone.Core.Download
public void DownloadReport(RemoteEpisode remoteEpisode) public void DownloadReport(RemoteEpisode remoteEpisode)
{ {
Ensure.That(() => remoteEpisode.Series).IsNotNull(); Ensure.That(() => remoteEpisode.Series).IsNotNull();
Ensure.That(() => remoteEpisode.Episodes).IsNotNull();
Ensure.That(() => remoteEpisode.Episodes).HasItems(); Ensure.That(() => remoteEpisode.Episodes).HasItems();
var downloadTitle = remoteEpisode.Release.Title; var downloadTitle = remoteEpisode.Release.Title;

@ -62,7 +62,6 @@ namespace NzbDrone.Core.Rest
return client.Execute(request).ValidateResponse(client); return client.Execute(request).ValidateResponse(client);
} }
public static void AddQueryString(this IRestRequest request, string name, object value) public static void AddQueryString(this IRestRequest request, string name, object value)
{ {
request.AddParameter(name, value.ToString(), ParameterType.GetOrPost); request.AddParameter(name, value.ToString(), ParameterType.GetOrPost);

Loading…
Cancel
Save