mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Show warning message for rTorrent that it doesn't support torrent removal
This commit is contained in:
parent
873fadbcaa
commit
14b9a031bb
@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Api.ClientSchema;
|
||||
using NzbDrone.Api.REST;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
|
||||
namespace NzbDrone.Api
|
||||
{
|
||||
@ -12,6 +13,7 @@ public class ProviderResource : RestResource
|
||||
public string Implementation { get; set; }
|
||||
public string ConfigContract { get; set; }
|
||||
public string InfoLink { get; set; }
|
||||
public ProviderMessage Message { get; set; }
|
||||
|
||||
public List<ProviderResource> Presets { get; set; }
|
||||
}
|
||||
|
@ -10,9 +10,9 @@
|
||||
using NLog;
|
||||
using NzbDrone.Core.Validation;
|
||||
using FluentValidation.Results;
|
||||
using System.Net;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.RemotePathMappings;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
|
||||
namespace NzbDrone.Core.Download.Clients.RTorrent
|
||||
{
|
||||
@ -92,6 +92,14 @@ public override string Name
|
||||
}
|
||||
}
|
||||
|
||||
public override ProviderMessage Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ProviderMessage("Sonarr is unable to remove torrents that have finished seeding when using rTorrent", ProviderMessageType.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
try
|
||||
|
@ -32,6 +32,14 @@ public Type ConfigContract
|
||||
}
|
||||
}
|
||||
|
||||
public virtual ProviderMessage Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||
{
|
||||
get
|
||||
|
@ -37,6 +37,14 @@ public Type ConfigContract
|
||||
get { return typeof(TSettings); }
|
||||
}
|
||||
|
||||
public virtual ProviderMessage Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||
{
|
||||
get
|
||||
|
@ -20,6 +20,14 @@ public Type ConfigContract
|
||||
}
|
||||
}
|
||||
|
||||
public virtual ProviderMessage Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||
{
|
||||
get
|
||||
|
@ -18,6 +18,14 @@ public Type ConfigContract
|
||||
}
|
||||
}
|
||||
|
||||
public virtual ProviderMessage Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||
{
|
||||
get
|
||||
|
@ -887,6 +887,7 @@
|
||||
<Compile Include="ThingiProvider\NullConfig.cs" />
|
||||
<Compile Include="ThingiProvider\ProviderDefinition.cs" />
|
||||
<Compile Include="ThingiProvider\ProviderFactory.cs" />
|
||||
<Compile Include="ThingiProvider\ProviderMessage.cs" />
|
||||
<Compile Include="ThingiProvider\ProviderRepository.cs" />
|
||||
<Compile Include="Tv\Actor.cs" />
|
||||
<Compile Include="Tv\AddSeriesOptions.cs" />
|
||||
|
@ -8,7 +8,7 @@ public interface IProvider
|
||||
{
|
||||
string Name { get; }
|
||||
Type ConfigContract { get; }
|
||||
|
||||
ProviderMessage Message { get; }
|
||||
IEnumerable<ProviderDefinition> DefaultDefinitions { get; }
|
||||
ProviderDefinition Definition { get; set; }
|
||||
ValidationResult Test();
|
||||
|
@ -11,6 +11,7 @@ public abstract class ProviderDefinition : ModelBase
|
||||
public string Implementation { get; set; }
|
||||
public string ConfigContract { get; set; }
|
||||
public virtual bool Enable { get; set; }
|
||||
public ProviderMessage Message { get; set; }
|
||||
|
||||
public IProviderConfig Settings
|
||||
{
|
||||
|
@ -141,6 +141,7 @@ protected virtual List<TProviderDefinition> Active()
|
||||
public virtual TProviderDefinition GetProviderCharacteristics(TProvider provider, TProviderDefinition definition)
|
||||
{
|
||||
definition.ImplementationName = provider.Name;
|
||||
definition.Message = provider.Message;
|
||||
|
||||
return definition;
|
||||
}
|
||||
|
21
src/NzbDrone.Core/ThingiProvider/ProviderMessage.cs
Normal file
21
src/NzbDrone.Core/ThingiProvider/ProviderMessage.cs
Normal file
@ -0,0 +1,21 @@
|
||||
namespace NzbDrone.Core.ThingiProvider
|
||||
{
|
||||
public class ProviderMessage
|
||||
{
|
||||
public string Message { get; set; }
|
||||
public ProviderMessageType Type { get; set; }
|
||||
|
||||
public ProviderMessage(string message, ProviderMessageType type)
|
||||
{
|
||||
Message = message;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ProviderMessageType
|
||||
{
|
||||
Info,
|
||||
Warning,
|
||||
Error
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
var Marionette = require('marionette');
|
||||
var Handlebars = require('handlebars');
|
||||
var _ = require('underscore');
|
||||
require('./FormMessage');
|
||||
|
||||
var _templateRenderer = function(templateName) {
|
||||
var templateFunction = Marionette.TemplateCache.get(templateName);
|
||||
|
17
src/UI/Form/FormMessage.js
Normal file
17
src/UI/Form/FormMessage.js
Normal file
@ -0,0 +1,17 @@
|
||||
var Handlebars = require('handlebars');
|
||||
|
||||
Handlebars.registerHelper('formMessage', function(message) {
|
||||
if (!message) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var level = message.type;
|
||||
|
||||
if (message.type === 'error') {
|
||||
level = 'danger';
|
||||
}
|
||||
|
||||
var messageHtml = '<div class="alert alert-{0}" role="alert">{1}</div>'.format(level, message.message);
|
||||
|
||||
return new Handlebars.SafeString(messageHtml);
|
||||
});
|
@ -8,6 +8,8 @@
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="modal-body download-client-modal">
|
||||
{{formMessage message}}
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Name</label>
|
||||
|
Loading…
Reference in New Issue
Block a user