New: Backend changes for new UI

This commit is contained in:
Qstick 2018-11-23 02:03:32 -05:00
parent e9eebd3ce6
commit 65efa15551
485 changed files with 11177 additions and 2233 deletions

View file

@ -1,6 +1,6 @@
using FluentAssertions; using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Api.ClientSchema; using Radarr.Http.ClientSchema;
using NzbDrone.Core.Annotations; using NzbDrone.Core.Annotations;
using NzbDrone.Test.Common; using NzbDrone.Test.Common;
@ -28,8 +28,8 @@ public void schema_should_have_proper_fields()
var schema = SchemaBuilder.ToSchema(model); var schema = SchemaBuilder.ToSchema(model);
schema.Should().Contain(c => c.Order == 1 && c.Name == "LastName" && c.Label == "Last Name" && c.HelpText == "Your Last Name" && (string) c.Value == "Poop"); schema.Should().Contain(c => c.Order == 1 && c.Name == "lastName" && c.Label == "Last Name" && c.HelpText == "Your Last Name" && (string) c.Value == "Poop");
schema.Should().Contain(c => c.Order == 0 && c.Name == "FirstName" && c.Label == "First Name" && c.HelpText == "Your First Name" && (string) c.Value == "Bob"); schema.Should().Contain(c => c.Order == 0 && c.Name == "firstName" && c.Label == "First Name" && c.HelpText == "Your First Name" && (string) c.Value == "Bob");
} }
} }

View file

@ -8,7 +8,7 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NzbDrone.Api.Test</RootNamespace> <RootNamespace>NzbDrone.Api.Test</RootNamespace>
<AssemblyName>NzbDrone.Api.Test</AssemblyName> <AssemblyName>Radarr.Api.Test</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
@ -92,6 +92,10 @@
<Project>{CADDFCE0-7509-4430-8364-2074E1EEFCA2}</Project> <Project>{CADDFCE0-7509-4430-8364-2074E1EEFCA2}</Project>
<Name>NzbDrone.Test.Common</Name> <Name>NzbDrone.Test.Common</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Radarr.Http\Radarr.Http.csproj">
<Project>{c5953dab-89db-46d9-a401-d620f54b776e}</Project>
<Name>Radarr.Http</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\NzbDrone.Test.Common\App.config"> <None Include="..\NzbDrone.Test.Common\App.config">

View file

@ -4,11 +4,11 @@
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("NzbDrone.Api.Test")] [assembly: AssemblyTitle("Radarr.Api.Test")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NzbDrone.Api.Test")] [assembly: AssemblyProduct("Radarr.Api.Test")]
[assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]

View file

@ -1,9 +1,10 @@
using NzbDrone.Core.Blacklisting; using NzbDrone.Core.Blacklisting;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using Radarr.Http;
namespace NzbDrone.Api.Blacklist namespace NzbDrone.Api.Blacklist
{ {
public class BlacklistModule : NzbDroneRestModule<BlacklistResource> public class BlacklistModule : RadarrRestModule<BlacklistResource>
{ {
private readonly IBlacklistService _blacklistService; private readonly IBlacklistService _blacklistService;

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Api.Movies; using NzbDrone.Api.Movies;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;

View file

@ -1,4 +0,0 @@
namespace NzbDrone.Api.ClientSchema
{
}

View file

@ -1,193 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Newtonsoft.Json.Linq;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Reflection;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Download.Clients.Nzbget;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Profiles;
namespace NzbDrone.Api.ClientSchema
{
public static class SchemaBuilder
{
public static List<Field> ToSchema(object model)
{
Ensure.That(model, () => model).IsNotNull();
var properties = model.GetType().GetSimpleProperties();
var result = new List<Field>(properties.Count);
foreach (var propertyInfo in properties)
{
var fieldAttribute = propertyInfo.GetAttribute<FieldDefinitionAttribute>(false);
if (fieldAttribute != null)
{
var field = new Field
{
Name = propertyInfo.Name,
Label = fieldAttribute.Label,
HelpText = fieldAttribute.HelpText,
HelpLink = fieldAttribute.HelpLink,
Order = fieldAttribute.Order,
Advanced = fieldAttribute.Advanced,
Type = fieldAttribute.Type.ToString().ToLowerInvariant()
};
var value = propertyInfo.GetValue(model, null);
if (propertyInfo.PropertyType.HasAttribute<FlagsAttribute>())
{
int intVal = (int)value;
value = Enum.GetValues(propertyInfo.PropertyType)
.Cast<int>()
.Where(f=> (f & intVal) == f)
.ToList();
}
if (value != null)
{
field.Value = value;
}
if (fieldAttribute.Type == FieldType.Select || fieldAttribute.Type == FieldType.Tag)
{
field.SelectOptions = GetSelectOptions(fieldAttribute.SelectOptions);
}
result.Add(field);
}
}
return result.OrderBy(r => r.Order).ToList();
}
public static object ReadFromSchema(List<Field> fields, Type targetType)
{
Ensure.That(targetType, () => targetType).IsNotNull();
var properties = targetType.GetSimpleProperties();
var target = Activator.CreateInstance(targetType);
foreach (var propertyInfo in properties)
{
var fieldAttribute = propertyInfo.GetAttribute<FieldDefinitionAttribute>(false);
if (fieldAttribute != null)
{
var field = fields.Find(f => f.Name == propertyInfo.Name);
if (propertyInfo.PropertyType == typeof(int))
{
var value = field.Value.ToString().ParseInt32();
propertyInfo.SetValue(target, value ?? 0, null);
}
else if (propertyInfo.PropertyType == typeof(long))
{
var value = field.Value.ToString().ParseInt64();
propertyInfo.SetValue(target, value ?? 0, null);
}
else if (propertyInfo.PropertyType == typeof(int?))
{
var value = field.Value.ToString().ParseInt32();
propertyInfo.SetValue(target, value, null);
}
else if (propertyInfo.PropertyType == typeof(Nullable<Int64>))
{
var value = field.Value.ToString().ParseInt64();
propertyInfo.SetValue(target, value, null);
}
else if (propertyInfo.PropertyType == typeof(IEnumerable<int>))
{
IEnumerable<int> value;
if (field.Value?.GetType() == typeof(JArray))
{
value = ((JArray)field.Value).Select(s => s.Value<int>());
}
else
{
value = field.Value?.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => Convert.ToInt32(s));
}
propertyInfo.SetValue(target, value, null);
}
else if (propertyInfo.PropertyType == typeof(IEnumerable<string>))
{
IEnumerable<string> value;
if (field.Value.GetType() == typeof(JArray))
{
value = ((JArray)field.Value).Select(s => s.Value<string>());
}
else
{
value = field.Value.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
}
propertyInfo.SetValue(target, value, null);
}
else if (propertyInfo.PropertyType.HasAttribute<FlagsAttribute>())
{
int value = field.Value.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => Convert.ToInt32(s)).Sum();
propertyInfo.SetValue(target, value, null);
}
else
{
propertyInfo.SetValue(target, field.Value, null);
}
}
}
return target;
}
public static T ReadFromSchema<T>(List<Field> fields)
{
return (T)ReadFromSchema(fields, typeof(T));
}
private static List<SelectOption> GetSelectOptions(Type selectOptions)
{
if (selectOptions == null || selectOptions == typeof(Profile))
{
return new List<SelectOption>();
}
if (selectOptions == typeof(Quality))
{
var qOptions = from Quality q in selectOptions.GetProperties(BindingFlags.Static | BindingFlags.Public)
select new SelectOption {Name = q.Name, Value = q.Id};
return qOptions.OrderBy(o => o.Value).ToList();
}
var options = from Enum e in Enum.GetValues(selectOptions)
select new SelectOption { Value = Convert.ToInt32(e), Name = e.ToString() };
if (selectOptions == typeof(NzbgetPriority))
{
return options.OrderBy(o => o.Value).ToList();
}
return options.OrderBy(o => o.Name).ToList();
}
}
}

View file

@ -1,7 +0,0 @@
namespace NzbDrone.Api.ClientSchema
{
public static class SchemaDeserializer
{
}
}

View file

@ -1,20 +1,22 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NLog; using NLog;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Api.Validation; using Radarr.Http.Validation;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.ProgressMessaging; using NzbDrone.Core.ProgressMessaging;
using NzbDrone.SignalR; using NzbDrone.SignalR;
using Radarr.Http;
using Radarr.Http.Mapping;
namespace NzbDrone.Api.Commands namespace NzbDrone.Api.Commands
{ {
public class CommandModule : NzbDroneRestModuleWithSignalR<CommandResource, CommandModel>, IHandle<CommandUpdatedEvent> public class CommandModule : RadarrRestModuleWithSignalR<CommandResource, CommandModel>, IHandle<CommandUpdatedEvent>
{ {
private readonly IManageCommandQueue _commandQueueManager; private readonly IManageCommandQueue _commandQueueManager;
private readonly IServiceFactory _serviceFactory; private readonly IServiceFactory _serviceFactory;

View file

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Api.Commands namespace NzbDrone.Api.Commands

View file

@ -1,4 +1,4 @@
using FluentValidation; using FluentValidation;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using NzbDrone.Core.Validation.Paths; using NzbDrone.Core.Validation.Paths;
@ -6,19 +6,10 @@ namespace NzbDrone.Api.Config
{ {
public class DownloadClientConfigModule : NzbDroneConfigModule<DownloadClientConfigResource> public class DownloadClientConfigModule : NzbDroneConfigModule<DownloadClientConfigResource>
{ {
public DownloadClientConfigModule(IConfigService configService, public DownloadClientConfigModule(IConfigService configService)
RootFolderValidator rootFolderValidator,
PathExistsValidator pathExistsValidator,
MappedNetworkDriveValidator mappedNetworkDriveValidator)
: base(configService) : base(configService)
{ {
SharedValidator.RuleFor(c => c.DownloadedMoviesFolder)
.Cascade(CascadeMode.StopOnFirstFailure)
.IsValidPath()
.SetValidator(rootFolderValidator)
.SetValidator(mappedNetworkDriveValidator)
.SetValidator(pathExistsValidator)
.When(c => !string.IsNullOrWhiteSpace(c.DownloadedMoviesFolder));
} }
protected override DownloadClientConfigResource ToResource(IConfigService model) protected override DownloadClientConfigResource ToResource(IConfigService model)

View file

@ -1,13 +1,11 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config
{ {
public class DownloadClientConfigResource : RestResource public class DownloadClientConfigResource : RestResource
{ {
public string DownloadedMoviesFolder { get; set; }
public string DownloadClientWorkingFolders { get; set; } public string DownloadClientWorkingFolders { get; set; }
public int DownloadedMoviesScanInterval { get; set; }
public bool EnableCompletedDownloadHandling { get; set; } public bool EnableCompletedDownloadHandling { get; set; }
public bool RemoveCompletedDownloads { get; set; } public bool RemoveCompletedDownloads { get; set; }
@ -23,9 +21,7 @@ public static DownloadClientConfigResource ToResource(IConfigService model)
{ {
return new DownloadClientConfigResource return new DownloadClientConfigResource
{ {
DownloadedMoviesFolder = model.DownloadedMoviesFolder,
DownloadClientWorkingFolders = model.DownloadClientWorkingFolders, DownloadClientWorkingFolders = model.DownloadClientWorkingFolders,
DownloadedMoviesScanInterval = model.DownloadedMoviesScanInterval,
EnableCompletedDownloadHandling = model.EnableCompletedDownloadHandling, EnableCompletedDownloadHandling = model.EnableCompletedDownloadHandling,
RemoveCompletedDownloads = model.RemoveCompletedDownloads, RemoveCompletedDownloads = model.RemoveCompletedDownloads,

View file

@ -1,4 +1,5 @@
using System.Linq; using System.IO;
using System.Linq;
using System.Reflection; using System.Reflection;
using FluentValidation; using FluentValidation;
using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.EnvironmentInfo;
@ -8,10 +9,11 @@
using NzbDrone.Core.Update; using NzbDrone.Core.Update;
using NzbDrone.Core.Validation; using NzbDrone.Core.Validation;
using NzbDrone.Core.Validation.Paths; using NzbDrone.Core.Validation.Paths;
using Radarr.Http;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config
{ {
public class HostConfigModule : NzbDroneRestModule<HostConfigResource> public class HostConfigModule : RadarrRestModule<HostConfigResource>
{ {
private readonly IConfigFileProvider _configFileProvider; private readonly IConfigFileProvider _configFileProvider;
private readonly IConfigService _configService; private readonly IConfigService _configService;
@ -45,6 +47,10 @@ public HostConfigModule(IConfigFileProvider configFileProvider, IConfigService c
SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'master' is the default"); SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'master' is the default");
SharedValidator.RuleFor(c => c.UpdateScriptPath).IsValidPath().When(c => c.UpdateMechanism == UpdateMechanism.Script); SharedValidator.RuleFor(c => c.UpdateScriptPath).IsValidPath().When(c => c.UpdateMechanism == UpdateMechanism.Script);
SharedValidator.RuleFor(c => c.BackupFolder).IsValidPath().When(c => Path.IsPathRooted(c.BackupFolder));
SharedValidator.RuleFor(c => c.BackupInterval).InclusiveBetween(1, 7);
SharedValidator.RuleFor(c => c.BackupRetention).InclusiveBetween(1, 90);
} }
private HostConfigResource GetHostConfig() private HostConfigResource GetHostConfig()

View file

@ -1,4 +1,4 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Authentication; using NzbDrone.Core.Authentication;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using NzbDrone.Core.Update; using NzbDrone.Core.Update;
@ -33,6 +33,9 @@ public class HostConfigResource : RestResource
public string ProxyPassword { get; set; } public string ProxyPassword { get; set; }
public string ProxyBypassFilter { get; set; } public string ProxyBypassFilter { get; set; }
public bool ProxyBypassLocalAddresses { get; set; } public bool ProxyBypassLocalAddresses { get; set; }
public string BackupFolder { get; set; }
public int BackupInterval { get; set; }
public int BackupRetention { get; set; }
} }
public static class HostConfigResourceMapper public static class HostConfigResourceMapper
@ -66,7 +69,10 @@ public static HostConfigResource ToResource(this IConfigFileProvider model, ICon
ProxyUsername = configService.ProxyUsername, ProxyUsername = configService.ProxyUsername,
ProxyPassword = configService.ProxyPassword, ProxyPassword = configService.ProxyPassword,
ProxyBypassFilter = configService.ProxyBypassFilter, ProxyBypassFilter = configService.ProxyBypassFilter,
ProxyBypassLocalAddresses = configService.ProxyBypassLocalAddresses ProxyBypassLocalAddresses = configService.ProxyBypassLocalAddresses,
BackupFolder = configService.BackupFolder,
BackupInterval = configService.BackupInterval,
BackupRetention = configService.BackupRetention
}; };
} }
} }

View file

@ -1,5 +1,5 @@
using FluentValidation; using FluentValidation;
using NzbDrone.Api.Validation; using Radarr.Http.Validation;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config

View file

@ -1,4 +1,4 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;

View file

@ -1,4 +1,4 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
@ -33,10 +33,10 @@ public static MediaManagementConfigResource ToResource(IConfigService model)
{ {
return new MediaManagementConfigResource return new MediaManagementConfigResource
{ {
AutoUnmonitorPreviouslyDownloadedEpisodes = model.AutoUnmonitorPreviouslyDownloadedEpisodes, AutoUnmonitorPreviouslyDownloadedEpisodes = model.AutoUnmonitorPreviouslyDownloadedMovies,
RecycleBin = model.RecycleBin, RecycleBin = model.RecycleBin,
AutoDownloadPropers = model.AutoDownloadPropers, AutoDownloadPropers = model.AutoDownloadPropers,
CreateEmptySeriesFolders = model.CreateEmptySeriesFolders, CreateEmptySeriesFolders = model.CreateEmptyMovieFolders,
FileDate = model.FileDate, FileDate = model.FileDate,
AutoRenameFolders = model.AutoRenameFolders, AutoRenameFolders = model.AutoRenameFolders,
PathsDefaultStatic = model.PathsDefaultStatic, PathsDefaultStatic = model.PathsDefaultStatic,

View file

@ -6,11 +6,13 @@
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.Organizer; using NzbDrone.Core.Organizer;
using Nancy.ModelBinding; using Nancy.ModelBinding;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using Radarr.Http;
using Radarr.Http.Mapping;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config
{ {
public class NamingConfigModule : NzbDroneRestModule<NamingConfigResource> public class NamingConfigModule : RadarrRestModule<NamingConfigResource>
{ {
private readonly INamingConfigService _namingConfigService; private readonly INamingConfigService _namingConfigService;
private readonly IFilenameSampleService _filenameSampleService; private readonly IFilenameSampleService _filenameSampleService;

View file

@ -1,4 +1,4 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Organizer; using NzbDrone.Core.Organizer;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config

View file

@ -1,5 +1,5 @@
using FluentValidation; using FluentValidation;
using NzbDrone.Api.Validation; using Radarr.Http.Validation;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config

View file

@ -1,4 +1,4 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config

View file

@ -1,11 +1,12 @@
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using NzbDrone.Api.REST; using Radarr.Http;
using Radarr.Http.REST;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config
{ {
public abstract class NzbDroneConfigModule<TResource> : NzbDroneRestModule<TResource> where TResource : RestResource, new() public abstract class NzbDroneConfigModule<TResource> : RadarrRestModule<TResource> where TResource : RestResource, new()
{ {
private readonly IConfigService _configService; private readonly IConfigService _configService;

View file

@ -1,4 +1,4 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config

View file

@ -1,9 +1,10 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.DiskSpace; using NzbDrone.Core.DiskSpace;
using Radarr.Http;
namespace NzbDrone.Api.DiskSpace namespace NzbDrone.Api.DiskSpace
{ {
public class DiskSpaceModule :NzbDroneRestModule<DiskSpaceResource> public class DiskSpaceModule :RadarrRestModule<DiskSpaceResource>
{ {
private readonly IDiskSpaceService _diskSpaceService; private readonly IDiskSpaceService _diskSpaceService;

View file

@ -1,4 +1,4 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
namespace NzbDrone.Api.DiskSpace namespace NzbDrone.Api.DiskSpace
{ {

View file

@ -1,13 +1,14 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Extras.Files; using NzbDrone.Core.Extras.Files;
using NzbDrone.Core.Extras.Metadata.Files; using NzbDrone.Core.Extras.Metadata.Files;
using NzbDrone.Core.Extras.Others; using NzbDrone.Core.Extras.Others;
using NzbDrone.Core.Extras.Subtitles; using NzbDrone.Core.Extras.Subtitles;
using Radarr.Http;
namespace NzbDrone.Api.ExtraFiles namespace NzbDrone.Api.ExtraFiles
{ {
public class ExtraFileModule : NzbDroneRestModule<ExtraFileResource> public class ExtraFileModule : RadarrRestModule<ExtraFileResource>
{ {
private readonly IExtraFileService<SubtitleFile> _subtitleFileService; private readonly IExtraFileService<SubtitleFile> _subtitleFileService;
private readonly IExtraFileService<MetadataFile> _metadataFileService; private readonly IExtraFileService<MetadataFile> _metadataFileService;

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Extras.Files; using NzbDrone.Core.Extras.Files;
using NzbDrone.Core.Extras.Metadata.Files; using NzbDrone.Core.Extras.Metadata.Files;
using NzbDrone.Core.Extras.Others; using NzbDrone.Core.Extras.Others;

View file

@ -1,8 +1,8 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Nancy; using Nancy;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Common.Disk; using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
@ -31,15 +31,10 @@ public FileSystemModule(IFileSystemLookupService fileSystemLookupService,
private Response GetContents() private Response GetContents()
{ {
var pathQuery = Request.Query.path; var pathQuery = Request.Query.path;
var includeFilesQuery = Request.Query.includeFiles; var includeFiles = Request.GetBooleanQueryParameter("includeFiles");
bool includeFiles = false; var allowFoldersWithoutTrailingSlashes = Request.GetBooleanQueryParameter("allowFoldersWithoutTrailingSlashes");
if (includeFilesQuery.HasValue) return _fileSystemLookupService.LookupContents((string)pathQuery.Value, includeFiles, allowFoldersWithoutTrailingSlashes).AsResponse();
{
includeFiles = Convert.ToBoolean(includeFilesQuery.Value);
}
return _fileSystemLookupService.LookupContents((string)pathQuery.Value, includeFiles).AsResponse();
} }
private Response GetEntityType() private Response GetEntityType()

View file

@ -1,121 +0,0 @@
using System;
using System.IO;
using System.Text.RegularExpressions;
using Nancy;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Analytics;
using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Frontend.Mappers
{
public class IndexHtmlMapper : StaticResourceMapperBase
{
private readonly IDiskProvider _diskProvider;
private readonly IConfigFileProvider _configFileProvider;
private readonly IAnalyticsService _analyticsService;
private readonly Func<ICacheBreakerProvider> _cacheBreakProviderFactory;
private readonly string _indexPath;
private static readonly Regex ReplaceRegex = new Regex(@"(?:(?<attribute>href|src|content)=\"")(?<path>.*?(?<extension>css|js|png|ico|ics|svg|json|xml))(?:\"")(?:\s(?<nohash>data-no-hash))?", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static string API_KEY;
private static string URL_BASE;
private string _generatedContent
;
public IndexHtmlMapper(IAppFolderInfo appFolderInfo,
IDiskProvider diskProvider,
IConfigFileProvider configFileProvider,
IAnalyticsService analyticsService,
Func<ICacheBreakerProvider> cacheBreakProviderFactory,
Logger logger)
: base(diskProvider, logger)
{
_diskProvider = diskProvider;
_configFileProvider = configFileProvider;
_analyticsService = analyticsService;
_cacheBreakProviderFactory = cacheBreakProviderFactory;
_indexPath = Path.Combine(appFolderInfo.StartUpFolder, _configFileProvider.UiFolder, "index.html");
API_KEY = configFileProvider.ApiKey;
URL_BASE = configFileProvider.UrlBase;
}
public override string Map(string resourceUrl)
{
return _indexPath;
}
public override bool CanHandle(string resourceUrl)
{
resourceUrl = resourceUrl.ToLowerInvariant();
return !resourceUrl.StartsWith("/content") &&
!resourceUrl.StartsWith("/mediacover") &&
!resourceUrl.Contains(".") &&
!resourceUrl.StartsWith("/login");
}
public override Response GetResponse(string resourceUrl)
{
var response = base.GetResponse(resourceUrl);
response.Headers["X-UA-Compatible"] = "IE=edge";
return response;
}
protected override Stream GetContentStream(string filePath)
{
var text = GetIndexText();
var stream = new MemoryStream();
var writer = new StreamWriter(stream);
writer.Write(text);
writer.Flush();
stream.Position = 0;
return stream;
}
private string GetIndexText()
{
if (RuntimeInfo.IsProduction && _generatedContent != null)
{
return _generatedContent;
}
var text = _diskProvider.ReadAllText(_indexPath);
var cacheBreakProvider = _cacheBreakProviderFactory();
text = ReplaceRegex.Replace(text, match =>
{
string url;
if (match.Groups["nohash"].Success)
{
url = match.Groups["path"].Value;
}
else
{
url = cacheBreakProvider.AddCacheBreakerToPath(match.Groups["path"].Value);
}
return string.Format("{0}=\"{1}{2}\"", match.Groups["attribute"].Value, URL_BASE, url);
});
text = text.Replace("API_ROOT", URL_BASE + "/api");
text = text.Replace("API_KEY", API_KEY);
text = text.Replace("APP_VERSION", BuildInfo.Version.ToString());
text = text.Replace("APP_BRANCH", _configFileProvider.Branch.ToLower());
text = text.Replace("APP_ANALYTICS", _analyticsService.IsEnabled.ToString().ToLowerInvariant());
text = text.Replace("URL_BASE", URL_BASE);
text = text.Replace("PRODUCTION", RuntimeInfo.IsProduction.ToString().ToLowerInvariant());
_generatedContent = text;
return _generatedContent;
}
}
}

View file

@ -1,90 +0,0 @@
using System;
using System.IO;
using System.Text.RegularExpressions;
using Nancy;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Frontend.Mappers
{
public class LoginHtmlMapper : StaticResourceMapperBase
{
private readonly IDiskProvider _diskProvider;
private readonly IConfigFileProvider _configFileProvider;
private readonly Func<ICacheBreakerProvider> _cacheBreakProviderFactory;
private readonly string _indexPath;
private static readonly Regex ReplaceRegex = new Regex("(?<=(?:href|src|data-main)=\").*?(?=\")", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static string URL_BASE;
private string _generatedContent;
public LoginHtmlMapper(IAppFolderInfo appFolderInfo,
IDiskProvider diskProvider,
IConfigFileProvider configFileProvider,
Func<ICacheBreakerProvider> cacheBreakProviderFactory,
Logger logger)
: base(diskProvider, logger)
{
_diskProvider = diskProvider;
_configFileProvider = configFileProvider;
_cacheBreakProviderFactory = cacheBreakProviderFactory;
_indexPath = Path.Combine(appFolderInfo.StartUpFolder, _configFileProvider.UiFolder, "login.html");
URL_BASE = configFileProvider.UrlBase;
}
public override string Map(string resourceUrl)
{
return _indexPath;
}
public override bool CanHandle(string resourceUrl)
{
return resourceUrl.StartsWith("/login");
}
public override Response GetResponse(string resourceUrl)
{
var response = base.GetResponse(resourceUrl);
response.Headers["X-UA-Compatible"] = "IE=edge";
return response;
}
protected override Stream GetContentStream(string filePath)
{
var text = GetLoginText();
var stream = new MemoryStream();
var writer = new StreamWriter(stream);
writer.Write(text);
writer.Flush();
stream.Position = 0;
return stream;
}
private string GetLoginText()
{
if (RuntimeInfo.IsProduction && _generatedContent != null)
{
return _generatedContent;
}
var text = _diskProvider.ReadAllText(_indexPath);
var cacheBreakProvider = _cacheBreakProviderFactory();
text = ReplaceRegex.Replace(text, match =>
{
var url = cacheBreakProvider.AddCacheBreakerToPath(match.Value);
return URL_BASE + url;
});
_generatedContent = text;
return _generatedContent;
}
}
}

View file

@ -1,12 +1,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.HealthCheck; using NzbDrone.Core.HealthCheck;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.SignalR; using NzbDrone.SignalR;
using Radarr.Http;
namespace NzbDrone.Api.Health namespace NzbDrone.Api.Health
{ {
public class HealthModule : NzbDroneRestModuleWithSignalR<HealthResource, HealthCheck>, public class HealthModule : RadarrRestModuleWithSignalR<HealthResource, HealthCheck>,
IHandle<HealthCheckCompleteEvent> IHandle<HealthCheckCompleteEvent>
{ {
private readonly IHealthCheckService _healthCheckService; private readonly IHealthCheckService _healthCheckService;

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Common.Http; using NzbDrone.Common.Http;
using NzbDrone.Core.HealthCheck; using NzbDrone.Core.HealthCheck;

View file

@ -1,15 +1,18 @@
using System; using System;
using System.Linq;
using Nancy; using Nancy;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Api.Movies; using NzbDrone.Api.Movies;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download; using NzbDrone.Core.Download;
using NzbDrone.Core.History; using NzbDrone.Core.History;
using Radarr.Http;
using Radarr.Http.REST;
namespace NzbDrone.Api.History namespace NzbDrone.Api.History
{ {
public class HistoryModule : NzbDroneRestModule<HistoryResource> public class HistoryModule : RadarrRestModule<HistoryResource>
{ {
private readonly IHistoryService _historyService; private readonly IHistoryService _historyService;
private readonly IQualityUpgradableSpecification _qualityUpgradableSpecification; private readonly IQualityUpgradableSpecification _qualityUpgradableSpecification;
@ -43,19 +46,19 @@ protected HistoryResource MapToResource(Core.History.History model)
private PagingResource<HistoryResource> GetHistory(PagingResource<HistoryResource> pagingResource) private PagingResource<HistoryResource> GetHistory(PagingResource<HistoryResource> pagingResource)
{ {
var movieId = Request.Query.MovieId; var movieId = Request.Query.MovieId;
var pagingSpec = pagingResource.MapToPagingSpec<HistoryResource, Core.History.History>("date", SortDirection.Descending); var pagingSpec = pagingResource.MapToPagingSpec<HistoryResource, Core.History.History>("date", SortDirection.Descending);
var filter = pagingResource.Filters.FirstOrDefault();
if (pagingResource.FilterKey == "eventType") if (filter != null && filter.Key == "eventType")
{ {
var filterValue = (HistoryEventType)Convert.ToInt32(pagingResource.FilterValue); var filterValue = (HistoryEventType)Convert.ToInt32(filter.Value);
pagingSpec.FilterExpression = v => v.EventType == filterValue; pagingSpec.FilterExpressions.Add(v => v.EventType == filterValue);
} }
if (movieId.HasValue) if (movieId.HasValue)
{ {
int i = (int)movieId; int i = (int)movieId;
pagingSpec.FilterExpression = h => h.MovieId == i; pagingSpec.FilterExpressions.Add(h => h.MovieId == i);
} }
return ApplyToPage(_historyService.Paged, pagingSpec, MapToResource); return ApplyToPage(_historyService.Paged, pagingSpec, MapToResource);

View file

@ -1,6 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Api.Movies; using NzbDrone.Api.Movies;
using NzbDrone.Core.History; using NzbDrone.Core.History;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;

View file

@ -10,7 +10,7 @@
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
using Nancy.ModelBinding; using Nancy.ModelBinding;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Common.Cache; using NzbDrone.Common.Cache;
using HttpStatusCode = System.Net.HttpStatusCode; using HttpStatusCode = System.Net.HttpStatusCode;

View file

@ -1,9 +1,10 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
using Radarr.Http;
namespace NzbDrone.Api.Indexers namespace NzbDrone.Api.Indexers
{ {
public abstract class ReleaseModuleBase : NzbDroneRestModule<ReleaseResource> public abstract class ReleaseModuleBase : RadarrRestModule<ReleaseResource>
{ {
protected virtual List<ReleaseResource> MapDecisions(IEnumerable<DownloadDecision> decisions) protected virtual List<ReleaseResource> MapDecisions(IEnumerable<DownloadDecision> decisions)
{ {

View file

@ -1,4 +1,4 @@
using Nancy; using Nancy;
using Nancy.ModelBinding; using Nancy.ModelBinding;
using FluentValidation; using FluentValidation;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
@ -6,7 +6,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using Radarr.Http.Mapping;
using NLog; using NLog;
namespace NzbDrone.Api.Indexers namespace NzbDrone.Api.Indexers

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json; using Newtonsoft.Json;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;

View file

@ -1,14 +1,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using NzbDrone.Common.Disk; using NzbDrone.Common.Disk;
using Nancy; using Nancy;
using Nancy.Responses; using Nancy.Responses;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using Radarr.Http;
namespace NzbDrone.Api.Logs namespace NzbDrone.Api.Logs
{ {
public abstract class LogFileModuleBase : NzbDroneRestModule<LogFileResource> public abstract class LogFileModuleBase : RadarrRestModule<LogFileResource>
{ {
protected const string LOGFILE_ROUTE = @"/(?<filename>[-.a-zA-Z0-9]+?\.txt)"; protected const string LOGFILE_ROUTE = @"/(?<filename>[-.a-zA-Z0-9]+?\.txt)";

View file

@ -1,5 +1,5 @@
using System; using System;
using NzbDrone.Api.REST; using Radarr.Http.REST;
namespace NzbDrone.Api.Logs namespace NzbDrone.Api.Logs
{ {

View file

@ -1,8 +1,10 @@
using NzbDrone.Core.Instrumentation; using System.Linq;
using NzbDrone.Core.Instrumentation;
using Radarr.Http;
namespace NzbDrone.Api.Logs namespace NzbDrone.Api.Logs
{ {
public class LogModule : NzbDroneRestModule<LogResource> public class LogModule : RadarrRestModule<LogResource>
{ {
private readonly ILogService _logService; private readonly ILogService _logService;
@ -21,27 +23,29 @@ private PagingResource<LogResource> GetLogs(PagingResource<LogResource> pagingRe
pageSpec.SortKey = "id"; pageSpec.SortKey = "id";
} }
if (pagingResource.FilterKey == "level") var filter = pagingResource.Filters.FirstOrDefault();
if (filter != null && filter.Key == "level")
{ {
switch (pagingResource.FilterValue) switch (filter.Value)
{ {
case "Fatal": case "Fatal":
pageSpec.FilterExpression = h => h.Level == "Fatal"; pageSpec.FilterExpressions.Add(h => h.Level == "Fatal");
break; break;
case "Error": case "Error":
pageSpec.FilterExpression = h => h.Level == "Fatal" || h.Level == "Error"; pageSpec.FilterExpressions.Add(h => h.Level == "Fatal" || h.Level == "Error");
break; break;
case "Warn": case "Warn":
pageSpec.FilterExpression = h => h.Level == "Fatal" || h.Level == "Error" || h.Level == "Warn"; pageSpec.FilterExpressions.Add(h => h.Level == "Fatal" || h.Level == "Error" || h.Level == "Warn");
break; break;
case "Info": case "Info":
pageSpec.FilterExpression = h => h.Level == "Fatal" || h.Level == "Error" || h.Level == "Warn" || h.Level == "Info"; pageSpec.FilterExpressions.Add(h => h.Level == "Fatal" || h.Level == "Error" || h.Level == "Warn" || h.Level == "Info");
break; break;
case "Debug": case "Debug":
pageSpec.FilterExpression = h => h.Level == "Fatal" || h.Level == "Error" || h.Level == "Warn" || h.Level == "Info" || h.Level == "Debug"; pageSpec.FilterExpressions.Add(h => h.Level == "Fatal" || h.Level == "Error" || h.Level == "Warn" || h.Level == "Info" || h.Level == "Debug");
break; break;
case "Trace": case "Trace":
pageSpec.FilterExpression = h => h.Level == "Fatal" || h.Level == "Error" || h.Level == "Warn" || h.Level == "Info" || h.Level == "Debug" || h.Level == "Trace"; pageSpec.FilterExpressions.Add(h => h.Level == "Fatal" || h.Level == "Error" || h.Level == "Warn" || h.Level == "Info" || h.Level == "Debug" || h.Level == "Trace");
break; break;
} }
} }

View file

@ -1,5 +1,5 @@
using System; using System;
using NzbDrone.Api.REST; using Radarr.Http.REST;
namespace NzbDrone.Api.Logs namespace NzbDrone.Api.Logs
{ {

View file

@ -1,11 +1,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Core.MediaFiles.MovieImport.Manual; using NzbDrone.Core.MediaFiles.MovieImport.Manual;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using Radarr.Http;
using Radarr.Http.Extensions;
namespace NzbDrone.Api.ManualImport namespace NzbDrone.Api.ManualImport
{ {
public class ManualImportModule : NzbDroneRestModule<ManualImportResource> public class ManualImportModule : RadarrRestModule<ManualImportResource>
{ {
private readonly IManualImportService _manualImportService; private readonly IManualImportService _manualImportService;
@ -24,8 +26,9 @@ private List<ManualImportResource> GetMediaFiles()
var downloadIdQuery = Request.Query.downloadId; var downloadIdQuery = Request.Query.downloadId;
var downloadId = (string)downloadIdQuery.Value; var downloadId = (string)downloadIdQuery.Value;
var filterExistingFiles = Request.GetBooleanQueryParameter("filterExistingFiles", true);
return _manualImportService.GetMediaFiles(folder, downloadId).ToResource().Select(AddQualityWeight).ToList(); return _manualImportService.GetMediaFiles(folder, downloadId, filterExistingFiles).ToResource().Select(AddQualityWeight).ToList();
} }
private ManualImportResource AddQualityWeight(ManualImportResource item) private ManualImportResource AddQualityWeight(ManualImportResource item)

View file

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.Movies; using NzbDrone.Api.Movies;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Common.Crypto; using NzbDrone.Common.Crypto;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;

View file

@ -1,7 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using NLog; using NLog;
using NzbDrone.Api.REST; using Radarr.Http;
using Radarr.Http.REST;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.Events; using NzbDrone.Core.MediaFiles.Events;
@ -12,7 +13,7 @@
namespace NzbDrone.Api.MovieFiles namespace NzbDrone.Api.MovieFiles
{ {
public class MovieFileModule : NzbDroneRestModuleWithSignalR<MovieFileResource, MovieFile>, IHandle<MovieFileAddedEvent> public class MovieFileModule : RadarrRestModuleWithSignalR<MovieFileResource, MovieFile>, IHandle<MovieFileAddedEvent>
{ {
private readonly IMediaFileService _mediaFileService; private readonly IMediaFileService _mediaFileService;
private readonly IRecycleBinProvider _recycleBinProvider; private readonly IRecycleBinProvider _recycleBinProvider;

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Api.Movies; using NzbDrone.Api.Movies;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;

View file

@ -16,10 +16,11 @@
using NzbDrone.Core.RootFolders; using NzbDrone.Core.RootFolders;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.Events; using NzbDrone.Core.Movies.Events;
using Radarr.Http;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
public class AlternativeTitleModule : NzbDroneRestModule<AlternativeTitleResource> public class AlternativeTitleModule : RadarrRestModule<AlternativeTitleResource>
{ {
private readonly IAlternativeTitleService _altTitleService; private readonly IAlternativeTitleService _altTitleService;
private readonly IMovieService _movieService; private readonly IMovieService _movieService;

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.MediaCover; using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;

View file

@ -17,10 +17,11 @@
using NzbDrone.Core.RootFolders; using NzbDrone.Core.RootFolders;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.Events; using NzbDrone.Core.Movies.Events;
using Radarr.Http;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
public class AlternativeYearModule : NzbDroneRestModule<AlternativeYearResource> public class AlternativeYearModule : RadarrRestModule<AlternativeYearResource>
{ {
private readonly IMovieService _movieService; private readonly IMovieService _movieService;
private readonly IRadarrAPIClient _radarrApi; private readonly IRadarrAPIClient _radarrApi;

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.MediaCover; using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;

View file

@ -1,14 +1,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using Nancy; using Nancy;
using NzbDrone.Api.Extensions;
using NzbDrone.Core.MediaCover; using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MetadataSource; using NzbDrone.Core.MetadataSource;
using System.Linq; using System.Linq;
using NzbDrone.Core.NetImport; using NzbDrone.Core.NetImport;
using Radarr.Http;
using Radarr.Http.Extensions;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
public class FetchMovieListModule : NzbDroneRestModule<MovieResource> public class FetchMovieListModule : RadarrRestModule<MovieResource>
{ {
private readonly IFetchNetImport _fetchNetImport; private readonly IFetchNetImport _fetchNetImport;
private readonly ISearchForNewMovie _movieSearch; private readonly ISearchForNewMovie _movieSearch;

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using Nancy; using Nancy;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Core.MediaCover; using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MetadataSource; using NzbDrone.Core.MetadataSource;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
@ -15,6 +15,7 @@
using NzbDrone.Common.Cache; using NzbDrone.Common.Cache;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.Core.Profiles; using NzbDrone.Core.Profiles;
using Radarr.Http;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
@ -27,7 +28,7 @@ public int Compare(UnmappedFolder a, UnmappedFolder b)
} }
} }
public class MovieBulkImportModule : NzbDroneRestModule<MovieResource> public class MovieBulkImportModule : RadarrRestModule<MovieResource>
{ {
private readonly ISearchForNewMovie _searchProxy; private readonly ISearchForNewMovie _searchProxy;
private readonly IRootFolderService _rootFolderService; private readonly IRootFolderService _rootFolderService;

View file

@ -1,17 +1,17 @@
using System.Collections.Generic; using System.Collections.Generic;
using Nancy; using Nancy;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Core.MediaCover; using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MetadataSource; using NzbDrone.Core.MetadataSource;
using System.Linq; using System.Linq;
using System; using System;
using NzbDrone.Api.REST; using Radarr.Http;
using NzbDrone.Core.NetImport; using NzbDrone.Core.NetImport;
using NzbDrone.Api.NetImport; using NzbDrone.Api.NetImport;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
public class MovieDiscoverModule : NzbDroneRestModule<MovieResource> public class MovieDiscoverModule : RadarrRestModule<MovieResource>
{ {
private readonly IDiscoverNewMovies _searchProxy; private readonly IDiscoverNewMovies _searchProxy;
private readonly INetImportFactory _netImportFactory; private readonly INetImportFactory _netImportFactory;

View file

@ -3,9 +3,10 @@
using System.Linq; using System.Linq;
using Nancy; using Nancy;
using Nancy.Responses; using Nancy.Responses;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using Radarr.Http.Mapping;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {

View file

@ -1,15 +1,16 @@
using System.Collections.Generic; using System.Collections.Generic;
using Nancy; using Nancy;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Core.MediaCover; using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MetadataSource; using NzbDrone.Core.MetadataSource;
using System.Linq; using System.Linq;
using System; using System;
using NzbDrone.Api.REST; using Radarr.Http;
using Radarr.Http.REST;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
public class MovieLookupModule : NzbDroneRestModule<MovieResource> public class MovieLookupModule : RadarrRestModule<MovieResource>
{ {
private readonly ISearchForNewMovie _searchProxy; private readonly ISearchForNewMovie _searchProxy;
private readonly IProvideMovieInfo _movieInfo; private readonly IProvideMovieInfo _movieInfo;

View file

@ -3,7 +3,7 @@
using System.Linq; using System.Linq;
using FluentValidation; using FluentValidation;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.MediaCover; using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
@ -17,10 +17,11 @@
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using Microsoft.CSharp.RuntimeBinder; using Microsoft.CSharp.RuntimeBinder;
using Nancy; using Nancy;
using Radarr.Http;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
public class MovieModule : NzbDroneRestModuleWithSignalR<MovieResource, Core.Movies.Movie>, public class MovieModule : RadarrRestModuleWithSignalR<MovieResource, Core.Movies.Movie>,
IHandle<MovieImportedEvent>, IHandle<MovieImportedEvent>,
IHandle<MovieFileDeletedEvent>, IHandle<MovieFileDeletedEvent>,
IHandle<MovieUpdatedEvent>, IHandle<MovieUpdatedEvent>,
@ -41,8 +42,8 @@ public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
RootFolderValidator rootFolderValidator, RootFolderValidator rootFolderValidator,
MoviePathValidator moviesPathValidator, MoviePathValidator moviesPathValidator,
MovieExistsValidator moviesExistsValidator, MovieExistsValidator moviesExistsValidator,
DroneFactoryValidator droneFactoryValidator,
MovieAncestorValidator moviesAncestorValidator, MovieAncestorValidator moviesAncestorValidator,
SystemFolderValidator systemFolderValidator,
ProfileExistsValidator profileExistsValidator ProfileExistsValidator profileExistsValidator
) )
: base(signalRBroadcaster) : base(signalRBroadcaster)
@ -64,15 +65,15 @@ ProfileExistsValidator profileExistsValidator
UpdateResource = UpdateMovie; UpdateResource = UpdateMovie;
DeleteResource = DeleteMovie; DeleteResource = DeleteMovie;
Validation.RuleBuilderExtensions.ValidId(SharedValidator.RuleFor(s => s.ProfileId)); SharedValidator.RuleFor(s => s.ProfileId).ValidId();
SharedValidator.RuleFor(s => s.Path) SharedValidator.RuleFor(s => s.Path)
.Cascade(CascadeMode.StopOnFirstFailure) .Cascade(CascadeMode.StopOnFirstFailure)
.IsValidPath() .IsValidPath()
.SetValidator(rootFolderValidator) .SetValidator(rootFolderValidator)
.SetValidator(moviesPathValidator) .SetValidator(moviesPathValidator)
.SetValidator(droneFactoryValidator)
.SetValidator(moviesAncestorValidator) .SetValidator(moviesAncestorValidator)
.SetValidator(systemFolderValidator)
.When(s => !s.Path.IsNullOrWhiteSpace()); .When(s => !s.Path.IsNullOrWhiteSpace());
SharedValidator.RuleFor(s => s.ProfileId).SetValidator(profileExistsValidator); SharedValidator.RuleFor(s => s.ProfileId).SetValidator(profileExistsValidator);
@ -110,14 +111,14 @@ private MovieResource GetMovie(int id)
private PagingResource<MovieResource> GetMoviePaged(PagingResource<MovieResource> pagingResource) private PagingResource<MovieResource> GetMoviePaged(PagingResource<MovieResource> pagingResource)
{ {
var pagingSpec = pagingResource.MapToPagingSpec<MovieResource, Core.Movies.Movie>(); var pagingSpec = pagingResource.MapToPagingSpec<MovieResource, Movie>();
pagingSpec.FilterExpression = _moviesService.ConstructFilterExpression(pagingResource.FilterKey, pagingResource.FilterValue, pagingResource.FilterType); pagingSpec.FilterExpressions.Add(_moviesService.ConstructFilterExpression(pagingResource.Filters.FirstOrDefault().Key, pagingResource.Filters.FirstOrDefault().Value));
return ApplyToPage(_moviesService.Paged, pagingSpec, MapToResource); return ApplyToPage(_moviesService.Paged, pagingSpec, MapToResource);
} }
protected MovieResource MapToResource(Core.Movies.Movie movies) protected MovieResource MapToResource(Movie movies)
{ {
if (movies == null) return null; if (movies == null) return null;

View file

@ -6,10 +6,11 @@
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.SignalR; using NzbDrone.SignalR;
using Radarr.Http;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
public abstract class MovieModuleWithSignalR : NzbDroneRestModuleWithSignalR<MovieResource, Core.Movies.Movie>, public abstract class MovieModuleWithSignalR : RadarrRestModuleWithSignalR<MovieResource, Core.Movies.Movie>,
IHandle<MovieGrabbedEvent>, IHandle<MovieGrabbedEvent>,
IHandle<MovieDownloadedEvent> IHandle<MovieDownloadedEvent>
{ {

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.MediaCover; using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.Api.MovieFiles; using NzbDrone.Api.MovieFiles;

View file

@ -1,13 +1,14 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Radarr.Http;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
public class RenameMovieModule : NzbDroneRestModule<RenameMovieResource> public class RenameMovieModule : RadarrRestModule<RenameMovieResource>
{ {
private readonly IRenameMovieFileService _renameMovieFileService; private readonly IRenameMovieFileService _renameMovieFileService;

View file

@ -1,4 +1,4 @@
using NzbDrone.Api.REST; using Radarr.Http.REST;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View file

@ -1,13 +1,14 @@
using System.Collections.Generic; using System.Collections.Generic;
using FluentValidation; using FluentValidation;
using NzbDrone.Api.ClientSchema; using Radarr.Http.ClientSchema;
using NzbDrone.Core.NetImport; using NzbDrone.Core.NetImport;
using NzbDrone.Core.NetImport.ImportExclusions; using NzbDrone.Core.NetImport.ImportExclusions;
using NzbDrone.Core.Validation.Paths; using NzbDrone.Core.Validation.Paths;
using Radarr.Http;
namespace NzbDrone.Api.NetImport namespace NzbDrone.Api.NetImport
{ {
public class ImportExclusionsModule : NzbDroneRestModule<ImportExclusionsResource> public class ImportExclusionsModule : RadarrRestModule<ImportExclusionsResource>
{ {
private readonly IImportExclusionsService _exclusionService; private readonly IImportExclusionsService _exclusionService;

View file

@ -2,7 +2,7 @@
using System.Linq; using System.Linq;
using Nancy; using Nancy;
using Nancy.Extensions; using Nancy.Extensions;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Api.Movies; using NzbDrone.Api.Movies;
using NzbDrone.Core.MetadataSource; using NzbDrone.Core.MetadataSource;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;

View file

@ -1,5 +1,5 @@
using FluentValidation; using FluentValidation;
using NzbDrone.Api.ClientSchema; using Radarr.Http.ClientSchema;
using NzbDrone.Core.NetImport; using NzbDrone.Core.NetImport;
using NzbDrone.Core.Validation.Paths; using NzbDrone.Core.Validation.Paths;

View file

@ -8,7 +8,7 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NzbDrone.Api</RootNamespace> <RootNamespace>NzbDrone.Api</RootNamespace>
<AssemblyName>NzbDrone.Api</AssemblyName> <AssemblyName>Radarr.Api</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
@ -91,31 +91,15 @@
<Compile Include="..\NzbDrone.Common\Properties\SharedAssemblyInfo.cs"> <Compile Include="..\NzbDrone.Common\Properties\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link> <Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="Authentication\AuthenticationService.cs" />
<Compile Include="Authentication\EnableAuthInNancy.cs" />
<Compile Include="Authentication\AuthenticationModule.cs" />
<Compile Include="Authentication\LoginResource.cs" />
<Compile Include="Authentication\NzbDroneUser.cs" />
<Compile Include="Blacklist\BlacklistModule.cs" /> <Compile Include="Blacklist\BlacklistModule.cs" />
<Compile Include="Blacklist\BlacklistResource.cs" /> <Compile Include="Blacklist\BlacklistResource.cs" />
<Compile Include="Calendar\CalendarFeedModule.cs" /> <Compile Include="Calendar\CalendarFeedModule.cs" />
<Compile Include="Calendar\CalendarModule.cs" /> <Compile Include="Calendar\CalendarModule.cs" />
<Compile Include="ClientSchema\Field.cs" />
<Compile Include="ClientSchema\FieldDefinitionAttribute.cs" />
<Compile Include="ClientSchema\SchemaBuilder.cs" />
<Compile Include="ClientSchema\SchemaDeserializer.cs" />
<Compile Include="ClientSchema\SelectOption.cs" />
<Compile Include="Commands\CommandModule.cs" /> <Compile Include="Commands\CommandModule.cs" />
<Compile Include="Commands\CommandResource.cs" /> <Compile Include="Commands\CommandResource.cs" />
<Compile Include="Config\NetImportConfigModule.cs" /> <Compile Include="Config\NetImportConfigModule.cs" />
<Compile Include="Config\NetImportConfigResource.cs" /> <Compile Include="Config\NetImportConfigResource.cs" />
<Compile Include="Extensions\AccessControlHeaders.cs" />
<Compile Include="Extensions\Pipelines\CorsPipeline.cs" />
<Compile Include="Extensions\Pipelines\UrlBasePipeline.cs" />
<Compile Include="Extensions\Pipelines\RequestLoggingPipeline.cs" />
<Compile Include="ExtraFiles\ExtraFileResource.cs" /> <Compile Include="ExtraFiles\ExtraFileResource.cs" />
<Compile Include="Frontend\Mappers\LoginHtmlMapper.cs" />
<Compile Include="Frontend\Mappers\RobotsTxtMapper.cs" />
<Compile Include="Indexers\ReleaseModuleBase.cs" /> <Compile Include="Indexers\ReleaseModuleBase.cs" />
<Compile Include="Indexers\ReleasePushModule.cs" /> <Compile Include="Indexers\ReleasePushModule.cs" />
<Compile Include="ExtraFiles\ExtraFileModule.cs" /> <Compile Include="ExtraFiles\ExtraFileModule.cs" />
@ -164,31 +148,6 @@
<Compile Include="DiskSpace\DiskSpaceResource.cs" /> <Compile Include="DiskSpace\DiskSpaceResource.cs" />
<Compile Include="DownloadClient\DownloadClientModule.cs" /> <Compile Include="DownloadClient\DownloadClientModule.cs" />
<Compile Include="DownloadClient\DownloadClientResource.cs" /> <Compile Include="DownloadClient\DownloadClientResource.cs" />
<Compile Include="ErrorManagement\ApiException.cs" />
<Compile Include="ErrorManagement\ErrorHandler.cs" />
<Compile Include="ErrorManagement\ErrorModel.cs" />
<Compile Include="ErrorManagement\NzbDroneErrorPipeline.cs" />
<Compile Include="Exceptions\InvalidApiKeyException.cs" />
<Compile Include="Extensions\NancyJsonSerializer.cs" />
<Compile Include="Extensions\Pipelines\CacheHeaderPipeline.cs" />
<Compile Include="Extensions\Pipelines\GZipPipeline.cs" />
<Compile Include="Extensions\Pipelines\IfModifiedPipeline.cs" />
<Compile Include="Extensions\Pipelines\IRegisterNancyPipeline.cs" />
<Compile Include="Extensions\Pipelines\NzbDroneVersionPipeline.cs" />
<Compile Include="Extensions\ReqResExtensions.cs" />
<Compile Include="Extensions\RequestExtensions.cs" />
<Compile Include="Frontend\CacheableSpecification.cs" />
<Compile Include="Frontend\Mappers\BackupFileMapper.cs" />
<Compile Include="Frontend\Mappers\CacheBreakerProvider.cs" />
<Compile Include="Frontend\Mappers\FaviconMapper.cs" />
<Compile Include="Frontend\Mappers\IMapHttpRequestsToDisk.cs" />
<Compile Include="Frontend\Mappers\IndexHtmlMapper.cs" />
<Compile Include="Frontend\Mappers\LogFileMapper.cs" />
<Compile Include="Frontend\Mappers\MediaCoverMapper.cs" />
<Compile Include="Frontend\Mappers\StaticResourceMapper.cs" />
<Compile Include="Frontend\Mappers\StaticResourceMapperBase.cs" />
<Compile Include="Frontend\Mappers\UpdateLogFileMapper.cs" />
<Compile Include="Frontend\StaticResourceModule.cs" />
<Compile Include="Health\HealthModule.cs" /> <Compile Include="Health\HealthModule.cs" />
<Compile Include="Health\HealthResource.cs" /> <Compile Include="Health\HealthResource.cs" />
<Compile Include="History\HistoryModule.cs" /> <Compile Include="History\HistoryModule.cs" />
@ -206,14 +165,10 @@
<Compile Include="MediaCovers\MediaCoverModule.cs" /> <Compile Include="MediaCovers\MediaCoverModule.cs" />
<Compile Include="Metadata\MetadataModule.cs" /> <Compile Include="Metadata\MetadataModule.cs" />
<Compile Include="Metadata\MetadataResource.cs" /> <Compile Include="Metadata\MetadataResource.cs" />
<Compile Include="NancyBootstrapper.cs" />
<Compile Include="Notifications\NotificationModule.cs" /> <Compile Include="Notifications\NotificationModule.cs" />
<Compile Include="Notifications\NotificationResource.cs" /> <Compile Include="Notifications\NotificationResource.cs" />
<Compile Include="NzbDroneApiModule.cs" /> <Compile Include="NzbDroneApiModule.cs" />
<Compile Include="NzbDroneFeedModule.cs" /> <Compile Include="NzbDroneFeedModule.cs" />
<Compile Include="NzbDroneRestModule.cs" />
<Compile Include="NzbDroneRestModuleWithSignalR.cs" />
<Compile Include="PagingResource.cs" />
<Compile Include="Profiles\Languages\LanguageModule.cs" /> <Compile Include="Profiles\Languages\LanguageModule.cs" />
<Compile Include="Profiles\Languages\LanguageResource.cs" /> <Compile Include="Profiles\Languages\LanguageResource.cs" />
<Compile Include="Profiles\LegacyProfileModule.cs" /> <Compile Include="Profiles\LegacyProfileModule.cs" />
@ -228,24 +183,15 @@
<Compile Include="Qualities\QualityDefinitionResource.cs" /> <Compile Include="Qualities\QualityDefinitionResource.cs" />
<Compile Include="Queue\QueueModule.cs" /> <Compile Include="Queue\QueueModule.cs" />
<Compile Include="Queue\QueueResource.cs" /> <Compile Include="Queue\QueueResource.cs" />
<Compile Include="ResourceChangeMessage.cs" />
<Compile Include="Restrictions\RestrictionModule.cs" /> <Compile Include="Restrictions\RestrictionModule.cs" />
<Compile Include="Restrictions\RestrictionResource.cs" /> <Compile Include="Restrictions\RestrictionResource.cs" />
<Compile Include="REST\NotFoundException.cs" />
<Compile Include="REST\BadRequestException.cs" />
<Compile Include="REST\MethodNotAllowedException.cs" />
<Compile Include="REST\ResourceValidator.cs" />
<Compile Include="REST\RestModule.cs" />
<Compile Include="REST\RestResource.cs" />
<Compile Include="RootFolders\RootFolderModule.cs" /> <Compile Include="RootFolders\RootFolderModule.cs" />
<Compile Include="RootFolders\RootFolderResource.cs" /> <Compile Include="RootFolders\RootFolderResource.cs" />
<Compile Include="Movies\AlternativeTitleResource.cs" /> <Compile Include="Movies\AlternativeTitleResource.cs" />
<Compile Include="MovieFiles\MovieFileResource.cs" /> <Compile Include="MovieFiles\MovieFileResource.cs" />
<Compile Include="Movies\FetchMovieListModule.cs" /> <Compile Include="Movies\FetchMovieListModule.cs" />
<Compile Include="Movies\MovieLookupModule.cs" /> <Compile Include="Movies\MovieLookupModule.cs" />
<Compile Include="Series\SeriesModule.cs" />
<Compile Include="Movies\MovieResource.cs" /> <Compile Include="Movies\MovieResource.cs" />
<Compile Include="Series\SeriesResource.cs" />
<Compile Include="System\Backup\BackupModule.cs" /> <Compile Include="System\Backup\BackupModule.cs" />
<Compile Include="System\Backup\BackupResource.cs" /> <Compile Include="System\Backup\BackupResource.cs" />
<Compile Include="System\Tasks\TaskModule.cs" /> <Compile Include="System\Tasks\TaskModule.cs" />
@ -253,13 +199,8 @@
<Compile Include="System\SystemModule.cs" /> <Compile Include="System\SystemModule.cs" />
<Compile Include="Tags\TagModule.cs" /> <Compile Include="Tags\TagModule.cs" />
<Compile Include="Tags\TagResource.cs" /> <Compile Include="Tags\TagResource.cs" />
<Compile Include="TinyIoCNancyBootstrapper.cs" />
<Compile Include="Update\UpdateModule.cs" /> <Compile Include="Update\UpdateModule.cs" />
<Compile Include="Update\UpdateResource.cs" /> <Compile Include="Update\UpdateResource.cs" />
<Compile Include="Validation\NetImportSyncIntervalValidator.cs" />
<Compile Include="Validation\RssSyncIntervalValidator.cs" />
<Compile Include="Validation\EmptyCollectionValidator.cs" />
<Compile Include="Validation\RuleBuilderExtensions.cs" />
<Compile Include="Wanted\LegacyMissingModule.cs" /> <Compile Include="Wanted\LegacyMissingModule.cs" />
<Compile Include="Wanted\MovieCutoffModule.cs" /> <Compile Include="Wanted\MovieCutoffModule.cs" />
<Compile Include="Wanted\MovieMissingModule.cs" /> <Compile Include="Wanted\MovieMissingModule.cs" />
@ -290,6 +231,10 @@
<Project>{7C2CC69F-5CA0-4E5C-85CB-983F9F6C3B36}</Project> <Project>{7C2CC69F-5CA0-4E5C-85CB-983F9F6C3B36}</Project>
<Name>NzbDrone.SignalR</Name> <Name>NzbDrone.SignalR</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Radarr.Http\Radarr.Http.csproj">
<Project>{c5953dab-89db-46d9-a401-d620f54b776e}</Project>
<Name>Radarr.Http</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View file

@ -1,66 +0,0 @@
using NzbDrone.Api.REST;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.SignalR;
namespace NzbDrone.Api
{
public abstract class NzbDroneRestModuleWithSignalR<TResource, TModel> : NzbDroneRestModule<TResource>, IHandle<ModelEvent<TModel>>
where TResource : RestResource, new()
where TModel : ModelBase, new()
{
private readonly IBroadcastSignalRMessage _signalRBroadcaster;
protected NzbDroneRestModuleWithSignalR(IBroadcastSignalRMessage signalRBroadcaster)
{
_signalRBroadcaster = signalRBroadcaster;
}
protected NzbDroneRestModuleWithSignalR(IBroadcastSignalRMessage signalRBroadcaster, string resource)
: base(resource)
{
_signalRBroadcaster = signalRBroadcaster;
}
public void Handle(ModelEvent<TModel> message)
{
if (message.Action == ModelAction.Deleted || message.Action == ModelAction.Sync)
{
BroadcastResourceChange(message.Action);
}
BroadcastResourceChange(message.Action, message.Model.Id);
}
protected void BroadcastResourceChange(ModelAction action, int id)
{
var resource = GetResourceById(id);
BroadcastResourceChange(action, resource);
}
protected void BroadcastResourceChange(ModelAction action, TResource resource)
{
var signalRMessage = new SignalRMessage
{
Name = Resource,
Body = new ResourceChangeMessage<TResource>(resource, action)
};
_signalRBroadcaster.BroadcastMessage(signalRMessage);
}
protected void BroadcastResourceChange(ModelAction action)
{
var signalRMessage = new SignalRMessage
{
Name = Resource,
Body = new ResourceChangeMessage<TResource>(action)
};
_signalRBroadcaster.BroadcastMessage(signalRMessage);
}
}
}

View file

@ -1,10 +1,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Api.Movies; using NzbDrone.Api.Movies;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using Radarr.Http;
namespace NzbDrone.Api.Parse namespace NzbDrone.Api.Parse
{ {
public class ParseModule : NzbDroneRestModule<ParseResource> public class ParseModule : RadarrRestModule<ParseResource>
{ {
private readonly IParsingService _parsingService; private readonly IParsingService _parsingService;

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Api.Movies; using NzbDrone.Api.Movies;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Api.Parse namespace NzbDrone.Api.Parse

View file

@ -1,13 +1,14 @@
using System.Collections.Generic; using System.Collections.Generic;
using FluentValidation; using FluentValidation;
using FluentValidation.Results; using FluentValidation.Results;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Api.Validation; using Radarr.Http.Validation;
using NzbDrone.Core.Profiles.Delay; using NzbDrone.Core.Profiles.Delay;
using Radarr.Http;
namespace NzbDrone.Api.Profiles.Delay namespace NzbDrone.Api.Profiles.Delay
{ {
public class DelayProfileModule : NzbDroneRestModule<DelayProfileResource> public class DelayProfileModule : RadarrRestModule<DelayProfileResource>
{ {
private readonly IDelayProfileService _delayProfileService; private readonly IDelayProfileService _delayProfileService;

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;
using NzbDrone.Core.Profiles.Delay; using NzbDrone.Core.Profiles.Delay;

View file

@ -1,11 +1,12 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using Radarr.Http;
namespace NzbDrone.Api.Profiles.Languages namespace NzbDrone.Api.Profiles.Languages
{ {
public class LanguageModule : NzbDroneRestModule<LanguageResource> public class LanguageModule : RadarrRestModule<LanguageResource>
{ {
public LanguageModule() public LanguageModule()
{ {

View file

@ -1,5 +1,5 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using NzbDrone.Api.REST; using Radarr.Http.REST;
namespace NzbDrone.Api.Profiles.Languages namespace NzbDrone.Api.Profiles.Languages
{ {

View file

@ -1,14 +1,16 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using FluentValidation; using FluentValidation;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.CustomFormats; using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.Profiles; using NzbDrone.Core.Profiles;
using NzbDrone.Core.Validation; using NzbDrone.Core.Validation;
using Radarr.Http;
using Radarr.Http.Mapping;
namespace NzbDrone.Api.Profiles namespace NzbDrone.Api.Profiles
{ {
public class ProfileModule : NzbDroneRestModule<ProfileResource> public class ProfileModule : RadarrRestModule<ProfileResource>
{ {
private readonly IProfileService _profileService; private readonly IProfileService _profileService;
private readonly ICustomFormatService _formatService; private readonly ICustomFormatService _formatService;

View file

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.Qualities; using NzbDrone.Api.Qualities;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using NzbDrone.Core.Profiles; using NzbDrone.Core.Profiles;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;

View file

@ -1,13 +1,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Core.CustomFormats; using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using NzbDrone.Core.Profiles; using NzbDrone.Core.Profiles;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using Radarr.Http;
using Radarr.Http.Mapping;
namespace NzbDrone.Api.Profiles namespace NzbDrone.Api.Profiles
{ {
public class ProfileSchemaModule : NzbDroneRestModule<ProfileResource> public class ProfileSchemaModule : RadarrRestModule<ProfileResource>
{ {
private readonly IQualityDefinitionService _qualityDefinitionService; private readonly IQualityDefinitionService _qualityDefinitionService;
private readonly ICustomFormatService _formatService; private readonly ICustomFormatService _formatService;

View file

@ -2,9 +2,9 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
[assembly: AssemblyTitle("NzbDrone.Api")] [assembly: AssemblyTitle("Radarr.Api")]
[assembly: Guid("4c0922d7-979e-4ff7-b44b-b8ac2100eeb5")] [assembly: Guid("4c0922d7-979e-4ff7-b44b-b8ac2100eeb5")]
[assembly: InternalsVisibleTo("NzbDrone.Core")] [assembly: InternalsVisibleTo("Radarr.Core")]

View file

@ -1,18 +1,20 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using FluentValidation; using FluentValidation;
using FluentValidation.Results; using FluentValidation.Results;
using Nancy; using Nancy;
using NzbDrone.Api.ClientSchema; using Radarr.Http.Extensions;
using NzbDrone.Api.Extensions;
using NzbDrone.Common.Reflection; using NzbDrone.Common.Reflection;
using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation; using NzbDrone.Core.Validation;
using Newtonsoft.Json; using Newtonsoft.Json;
using Radarr.Http;
using Radarr.Http.ClientSchema;
using Radarr.Http.Mapping;
namespace NzbDrone.Api namespace NzbDrone.Api
{ {
public abstract class ProviderModuleBase<TProviderResource, TProvider, TProviderDefinition> : NzbDroneRestModule<TProviderResource> public abstract class ProviderModuleBase<TProviderResource, TProvider, TProviderDefinition> : RadarrRestModule<TProviderResource>
where TProviderDefinition : ProviderDefinition, new() where TProviderDefinition : ProviderDefinition, new()
where TProvider : IProvider where TProvider : IProvider
where TProviderResource : ProviderResource, new() where TProviderResource : ProviderResource, new()

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Api.ClientSchema; using Radarr.Http.ClientSchema;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.ThingiProvider;
namespace NzbDrone.Api namespace NzbDrone.Api

View file

@ -1,15 +1,16 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using FluentValidation; using FluentValidation;
using Nancy; using Nancy;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Api.Validation; using Radarr.Http.Validation;
using NzbDrone.Core.CustomFormats; using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using Radarr.Http;
namespace NzbDrone.Api.Qualities namespace NzbDrone.Api.Qualities
{ {
public class CustomFormatModule : NzbDroneRestModule<CustomFormatResource> public class CustomFormatModule : RadarrRestModule<CustomFormatResource>
{ {
private readonly ICustomFormatService _formatService; private readonly ICustomFormatService _formatService;
private readonly IParsingService _parsingService; private readonly IParsingService _parsingService;
@ -22,7 +23,7 @@ public CustomFormatModule(ICustomFormatService formatService, IParsingService pa
SharedValidator.RuleFor(c => c.Name).NotEmpty(); SharedValidator.RuleFor(c => c.Name).NotEmpty();
SharedValidator.RuleFor(c => c.Name) SharedValidator.RuleFor(c => c.Name)
.Must((v, c) => !_formatService.All().Any(f => f.Name == c && f.Id != v.Id)).WithMessage("Must be unique."); .Must((v, c) => !_formatService.All().Any(f => f.Name == c && f.Id != v.Id)).WithMessage("Must be unique.");
SharedValidator.RuleFor(c => c.FormatTags).AreValidFormatTags(); SharedValidator.RuleFor(c => c.FormatTags).SetValidator(new FormatTagValidator());
SharedValidator.RuleFor(c => c.FormatTags).Must((v, c) => SharedValidator.RuleFor(c => c.FormatTags).Must((v, c) =>
{ {
var allFormats = _formatService.All(); var allFormats = _formatService.All();

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.CustomFormats; using NzbDrone.Core.CustomFormats;
namespace NzbDrone.Api.Qualities namespace NzbDrone.Api.Qualities

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.CustomFormats; using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;

View file

@ -1,13 +1,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using Radarr.Http;
namespace NzbDrone.Api.Qualities namespace NzbDrone.Api.Qualities
{ {
public class QualityDefinitionModule : NzbDroneRestModule<QualityDefinitionResource> public class QualityDefinitionModule : RadarrRestModule<QualityDefinitionResource>
{ {
private readonly IQualityDefinitionService _qualityDefinitionService; private readonly IQualityDefinitionService _qualityDefinitionService;
private readonly IParsingService _parsingService; private readonly IParsingService _parsingService;

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
namespace NzbDrone.Api.Qualities namespace NzbDrone.Api.Qualities

View file

@ -1,16 +1,17 @@
using System; using System;
using Nancy; using Nancy;
using Nancy.Responses; using Nancy.Responses;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Download; using NzbDrone.Core.Download;
using NzbDrone.Core.Download.Pending; using NzbDrone.Core.Download.Pending;
using NzbDrone.Core.Download.TrackedDownloads; using NzbDrone.Core.Download.TrackedDownloads;
using NzbDrone.Core.Queue; using NzbDrone.Core.Queue;
using Radarr.Http;
namespace NzbDrone.Api.Queue namespace NzbDrone.Api.Queue
{ {
public class QueueActionModule : NzbDroneRestModule<QueueResource> public class QueueActionModule : RadarrRestModule<QueueResource>
{ {
private readonly IQueueService _queueService; private readonly IQueueService _queueService;
private readonly ITrackedDownloadService _trackedDownloadService; private readonly ITrackedDownloadService _trackedDownloadService;

View file

@ -1,14 +1,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.Download.Pending; using NzbDrone.Core.Download.Pending;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Queue; using NzbDrone.Core.Queue;
using NzbDrone.SignalR; using NzbDrone.SignalR;
using Radarr.Http;
namespace NzbDrone.Api.Queue namespace NzbDrone.Api.Queue
{ {
public class QueueModule : NzbDroneRestModuleWithSignalR<QueueResource, Core.Queue.Queue>, public class QueueModule : RadarrRestModuleWithSignalR<QueueResource, Core.Queue.Queue>,
IHandle<QueueUpdatedEvent>, IHandle<PendingReleasesUpdatedEvent> IHandle<QueueUpdatedEvent>, IHandle<PendingReleasesUpdatedEvent>
{ {
private readonly IQueueService _queueService; private readonly IQueueService _queueService;

View file

@ -1,6 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using NzbDrone.Api.Movies; using NzbDrone.Api.Movies;
using NzbDrone.Core.Download.TrackedDownloads; using NzbDrone.Core.Download.TrackedDownloads;

View file

@ -1,11 +1,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using FluentValidation; using FluentValidation;
using NzbDrone.Core.RemotePathMappings; using NzbDrone.Core.RemotePathMappings;
using NzbDrone.Core.Validation.Paths; using NzbDrone.Core.Validation.Paths;
using Radarr.Http;
namespace NzbDrone.Api.RemotePathMappings namespace NzbDrone.Api.RemotePathMappings
{ {
public class RemotePathMappingModule : NzbDroneRestModule<RemotePathMappingResource> public class RemotePathMappingModule : RadarrRestModule<RemotePathMappingResource>
{ {
private readonly IRemotePathMappingService _remotePathMappingService; private readonly IRemotePathMappingService _remotePathMappingService;

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.RemotePathMappings; using NzbDrone.Core.RemotePathMappings;
namespace NzbDrone.Api.RemotePathMappings namespace NzbDrone.Api.RemotePathMappings

View file

@ -1,11 +1,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using FluentValidation.Results; using FluentValidation.Results;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.Restrictions; using NzbDrone.Core.Restrictions;
using Radarr.Http;
namespace NzbDrone.Api.Restrictions namespace Radarr.Http.RESTrictions
{ {
public class RestrictionModule : NzbDroneRestModule<RestrictionResource> public class RestrictionModule : RadarrRestModule<RestrictionResource>
{ {
private readonly IRestrictionService _restrictionService; private readonly IRestrictionService _restrictionService;

View file

@ -1,9 +1,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Restrictions; using NzbDrone.Core.Restrictions;
namespace NzbDrone.Api.Restrictions namespace Radarr.Http.RESTrictions
{ {
public class RestrictionResource : RestResource public class RestrictionResource : RestResource
{ {

View file

@ -1,12 +1,14 @@
using System.Collections.Generic; using System.Collections.Generic;
using FluentValidation; using FluentValidation;
using NzbDrone.Core.RootFolders; using NzbDrone.Core.RootFolders;
using NzbDrone.Core.Validation.Paths; using NzbDrone.Core.Validation.Paths;
using NzbDrone.SignalR; using NzbDrone.SignalR;
using Radarr.Http;
using Radarr.Http.Mapping;
namespace NzbDrone.Api.RootFolders namespace NzbDrone.Api.RootFolders
{ {
public class RootFolderModule : NzbDroneRestModuleWithSignalR<RootFolderResource, RootFolder> public class RootFolderModule : RadarrRestModuleWithSignalR<RootFolderResource, RootFolder>
{ {
private readonly IRootFolderService _rootFolderService; private readonly IRootFolderService _rootFolderService;
@ -14,9 +16,9 @@ public RootFolderModule(IRootFolderService rootFolderService,
IBroadcastSignalRMessage signalRBroadcaster, IBroadcastSignalRMessage signalRBroadcaster,
RootFolderValidator rootFolderValidator, RootFolderValidator rootFolderValidator,
PathExistsValidator pathExistsValidator, PathExistsValidator pathExistsValidator,
DroneFactoryValidator droneFactoryValidator,
MappedNetworkDriveValidator mappedNetworkDriveValidator, MappedNetworkDriveValidator mappedNetworkDriveValidator,
StartupFolderValidator startupFolderValidator, StartupFolderValidator startupFolderValidator,
SystemFolderValidator systemFolderValidator,
FolderWritableValidator folderWritableValidator) FolderWritableValidator folderWritableValidator)
: base(signalRBroadcaster) : base(signalRBroadcaster)
{ {
@ -31,10 +33,10 @@ public RootFolderModule(IRootFolderService rootFolderService,
.Cascade(CascadeMode.StopOnFirstFailure) .Cascade(CascadeMode.StopOnFirstFailure)
.IsValidPath() .IsValidPath()
.SetValidator(rootFolderValidator) .SetValidator(rootFolderValidator)
.SetValidator(droneFactoryValidator)
.SetValidator(mappedNetworkDriveValidator) .SetValidator(mappedNetworkDriveValidator)
.SetValidator(startupFolderValidator) .SetValidator(startupFolderValidator)
.SetValidator(pathExistsValidator) .SetValidator(pathExistsValidator)
.SetValidator(systemFolderValidator)
.SetValidator(folderWritableValidator); .SetValidator(folderWritableValidator);
} }

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.RootFolders; using NzbDrone.Core.RootFolders;
namespace NzbDrone.Api.RootFolders namespace NzbDrone.Api.RootFolders

View file

@ -1,47 +0,0 @@
using System;
using System.Collections.Generic;
using NzbDrone.SignalR;
namespace NzbDrone.Api.Series
{
[Obsolete("SeriesModule is Obsolete, Remove with new UI")]
public class SeriesModule : NzbDroneRestModuleWithSignalR<SeriesResource, Core.Movies.Movie>
{
public SeriesModule(IBroadcastSignalRMessage signalRBroadcaster
)
: base(signalRBroadcaster)
{
GetResourceAll = AllSeries;
GetResourceById = GetSeries;
CreateResource = AddSeries;
UpdateResource = UpdateSeries;
DeleteResource = DeleteSeries;
}
private SeriesResource GetSeries(int id)
{
return new SeriesResource();
}
private List<SeriesResource> AllSeries()
{
return new List<SeriesResource>();
}
private int AddSeries(SeriesResource seriesResource)
{
return 0;
}
private void UpdateSeries(SeriesResource seriesResource)
{
throw new NotImplementedException();
}
private void DeleteSeries(int id)
{
throw new NotImplementedException();
}
}
}

View file

@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using NzbDrone.Api.REST;
namespace NzbDrone.Api.Series
{
[Obsolete("SeriesResource is Obsolete, Remove with new UI")]
public class SeriesResource : RestResource
{
public SeriesResource()
{
Title = "Series Endpoint Obsolete";
}
//View Only
public string Title { get; set; }
}
}

View file

@ -1,11 +1,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using NzbDrone.Core.Backup; using NzbDrone.Core.Backup;
using Radarr.Http;
namespace NzbDrone.Api.System.Backup namespace NzbDrone.Api.System.Backup
{ {
public class BackupModule : NzbDroneRestModule<BackupResource> public class BackupModule : RadarrRestModule<BackupResource>
{ {
private readonly IBackupService _backupService; private readonly IBackupService _backupService;

View file

@ -1,5 +1,5 @@
using System; using System;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Backup; using NzbDrone.Core.Backup;
namespace NzbDrone.Api.System.Backup namespace NzbDrone.Api.System.Backup

View file

@ -1,6 +1,6 @@
using Nancy; using Nancy;
using Nancy.Routing; using Nancy.Routing;
using NzbDrone.Api.Extensions; using Radarr.Http.Extensions;
using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;

View file

@ -5,10 +5,11 @@
using NzbDrone.Core.Jobs; using NzbDrone.Core.Jobs;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.SignalR; using NzbDrone.SignalR;
using Radarr.Http;
namespace NzbDrone.Api.System.Tasks namespace NzbDrone.Api.System.Tasks
{ {
public class TaskModule : NzbDroneRestModuleWithSignalR<TaskResource, ScheduledTask>, IHandle<CommandExecutedEvent> public class TaskModule : RadarrRestModuleWithSignalR<TaskResource, ScheduledTask>, IHandle<CommandExecutedEvent>
{ {
private readonly ITaskManager _taskManager; private readonly ITaskManager _taskManager;

View file

@ -1,5 +1,5 @@
using System; using System;
using NzbDrone.Api.REST; using Radarr.Http.REST;
namespace NzbDrone.Api.System.Tasks namespace NzbDrone.Api.System.Tasks
{ {

View file

@ -1,12 +1,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tags; using NzbDrone.Core.Tags;
using NzbDrone.SignalR; using NzbDrone.SignalR;
using Radarr.Http;
namespace NzbDrone.Api.Tags namespace NzbDrone.Api.Tags
{ {
public class TagModule : NzbDroneRestModuleWithSignalR<TagResource, Tag>, IHandle<TagsUpdatedEvent> public class TagModule : RadarrRestModuleWithSignalR<TagResource, Tag>, IHandle<TagsUpdatedEvent>
{ {
private readonly ITagService _tagService; private readonly ITagService _tagService;

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using Radarr.Http.REST;
using NzbDrone.Core.Tags; using NzbDrone.Core.Tags;
namespace NzbDrone.Api.Tags namespace NzbDrone.Api.Tags

Some files were not shown because too many files have changed in this diff Show more