mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 12:32:31 +01:00
Cleaned up some validation
This commit is contained in:
parent
a40ad82fa7
commit
5343bde070
@ -40,7 +40,7 @@ public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
|
||||
GetResourceAll = GetReleases;
|
||||
Post["/"] = x=> DownloadRelease(this.Bind<ReleaseResource>());
|
||||
|
||||
PostValidator.RuleFor(s => s.DownloadAllowed);
|
||||
PostValidator.RuleFor(s => s.DownloadAllowed).Equal(true);
|
||||
}
|
||||
|
||||
private Response DownloadRelease(ReleaseResource release)
|
||||
|
@ -29,7 +29,6 @@ public DownloadService(IProvideDownloadClient downloadClientProvider,
|
||||
public void DownloadReport(RemoteEpisode remoteEpisode)
|
||||
{
|
||||
Ensure.That(() => remoteEpisode.Series).IsNotNull();
|
||||
Ensure.That(() => remoteEpisode.Episodes).IsNotNull();
|
||||
Ensure.That(() => remoteEpisode.Episodes).HasItems();
|
||||
|
||||
var downloadTitle = remoteEpisode.Release.Title;
|
||||
|
@ -62,7 +62,6 @@ public static IRestResponse ExecuteAndValidate(this IRestClient client, IRestReq
|
||||
return client.Execute(request).ValidateResponse(client);
|
||||
}
|
||||
|
||||
|
||||
public static void AddQueryString(this IRestRequest request, string name, object value)
|
||||
{
|
||||
request.AddParameter(name, value.ToString(), ParameterType.GetOrPost);
|
||||
|
Loading…
Reference in New Issue
Block a user