mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-13 18:27:08 -07:00
signalr cleanup
This commit is contained in:
parent
feda4a9b67
commit
25e2c98c45
219 changed files with 2035 additions and 1495 deletions
|
@ -9,6 +9,8 @@ namespace NzbDrone.Api
|
|||
{
|
||||
public abstract class NzbDroneRestModule<TResource> : RestModule<TResource> where TResource : RestResource, new()
|
||||
{
|
||||
protected string Resource { get; private set; }
|
||||
|
||||
protected NzbDroneRestModule()
|
||||
: this(new TResource().ResourceName)
|
||||
{
|
||||
|
@ -17,6 +19,7 @@ namespace NzbDrone.Api
|
|||
protected NzbDroneRestModule(string resource)
|
||||
: base("/api/" + resource.Trim('/'))
|
||||
{
|
||||
Resource = resource;
|
||||
PostValidator.RuleFor(r => r.Id).IsZero();
|
||||
PutValidator.RuleFor(r => r.Id).ValidId();
|
||||
}
|
||||
|
@ -28,7 +31,7 @@ namespace NzbDrone.Api
|
|||
return model.Id;
|
||||
}
|
||||
|
||||
protected List<TResource> ToListResource<TModel>(Func<IEnumerable<TModel>> function) where TModel : ModelBase, new()
|
||||
protected List<TResource> ToListResource<TModel>(Func<IEnumerable<TModel>> function) where TModel : class
|
||||
{
|
||||
var modelList = function();
|
||||
return modelList.InjectTo<List<TResource>>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue