Translate backend: Autotagging + CF specs, Metadata + ImportLists

Signed-off-by: Stevie Robinson <stevie.robinson@gmail.com>
pull/6381/head v4.0.0.924
Stevie Robinson 4 months ago committed by Mark McDowall
parent 9884f6f282
commit de1cc25c90

@ -23,7 +23,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications
public override int Order => 1;
public override string ImplementationName => "Genre";
[FieldDefinition(1, Label = "Genre(s)", Type = FieldType.Tag)]
[FieldDefinition(1, Label = "AutoTaggingSpecificationGenre", Type = FieldType.Tag)]
public IEnumerable<string> Value { get; set; }
protected override bool IsSatisfiedByWithoutNegate(Series series)

@ -21,7 +21,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications
public override int Order => 1;
public override string ImplementationName => "Original Language";
[FieldDefinition(1, Label = "Language", Type = FieldType.Select, SelectOptions = typeof(OriginalLanguageFieldConverter))]
[FieldDefinition(1, Label = "AutoTaggingSpecificationOriginalLanguage", Type = FieldType.Select, SelectOptions = typeof(OriginalLanguageFieldConverter))]
public int Value { get; set; }
protected override bool IsSatisfiedByWithoutNegate(Series series)

@ -20,7 +20,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications
public override int Order => 1;
public override string ImplementationName => "Quality Profile";
[FieldDefinition(1, Label = "Quality Profile", Type = FieldType.QualityProfile)]
[FieldDefinition(1, Label = "AutoTaggingSpecificationQualityProfile", Type = FieldType.QualityProfile)]
public int Value { get; set; }
protected override bool IsSatisfiedByWithoutNegate(Series series)

@ -22,7 +22,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications
public override int Order => 1;
public override string ImplementationName => "Root Folder";
[FieldDefinition(1, Label = "Root Folder", Type = FieldType.RootFolder)]
[FieldDefinition(1, Label = "AutoTaggingSpecificationRootFolder", Type = FieldType.RootFolder)]
public string Value { get; set; }
protected override bool IsSatisfiedByWithoutNegate(Series series)

@ -20,7 +20,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications
public override int Order => 2;
public override string ImplementationName => "Series Type";
[FieldDefinition(1, Label = "Series Type", Type = FieldType.Select, SelectOptions = typeof(SeriesTypes))]
[FieldDefinition(1, Label = "AutoTaggingSpecificationSeriesType", Type = FieldType.Select, SelectOptions = typeof(SeriesTypes))]
public int Value { get; set; }
protected override bool IsSatisfiedByWithoutNegate(Series series)

@ -16,7 +16,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications
public override int Order => 1;
public override string ImplementationName => "Status";
[FieldDefinition(1, Label = "Status", Type = FieldType.Select, SelectOptions = typeof(SeriesStatusType))]
[FieldDefinition(1, Label = "AutoTaggingSpecificationStatus", Type = FieldType.Select, SelectOptions = typeof(SeriesStatusType))]
public int Status { get; set; }
protected override bool IsSatisfiedByWithoutNegate(Series series)

@ -23,10 +23,10 @@ namespace NzbDrone.Core.AutoTagging.Specifications
public override int Order => 1;
public override string ImplementationName => "Year";
[FieldDefinition(1, Label = "Minimum Year", Type = FieldType.Number)]
[FieldDefinition(1, Label = "AutoTaggingSpecificationMinimumYear", Type = FieldType.Number)]
public int Min { get; set; }
[FieldDefinition(2, Label = "Maximum Year", Type = FieldType.Number)]
[FieldDefinition(2, Label = "AutoTaggingSpecificationMaximumYear", Type = FieldType.Number)]
public int Max { get; set; }
protected override bool IsSatisfiedByWithoutNegate(Series series)

@ -27,7 +27,7 @@ namespace NzbDrone.Core.CustomFormats
public override int Order => 3;
public override string ImplementationName => "Language";
[FieldDefinition(1, Label = "Language", Type = FieldType.Select, SelectOptions = typeof(LanguageFieldConverter))]
[FieldDefinition(1, Label = "CustomFormatsSpecificationLanguage", Type = FieldType.Select, SelectOptions = typeof(LanguageFieldConverter))]
public int Value { get; set; }
protected override bool IsSatisfiedByWithoutNegate(CustomFormatInput input)

@ -21,7 +21,7 @@ namespace NzbDrone.Core.CustomFormats
protected Regex _regex;
protected string _raw;
[FieldDefinition(1, Label = "Regular Expression", HelpText = "Custom Format RegEx is Case Insensitive")]
[FieldDefinition(1, Label = "CustomFormatsSpecificationRegularExpression", HelpText = "CustomFormatsSpecificationRegularExpressionHelpText")]
public string Value
{
get => _raw;

@ -20,7 +20,7 @@ namespace NzbDrone.Core.CustomFormats
public override int Order => 6;
public override string ImplementationName => "Resolution";
[FieldDefinition(1, Label = "Resolution", Type = FieldType.Select, SelectOptions = typeof(Resolution))]
[FieldDefinition(1, Label = "CustomFormatsSpecificationResolution", Type = FieldType.Select, SelectOptions = typeof(Resolution))]
public int Value { get; set; }
protected override bool IsSatisfiedByWithoutNegate(CustomFormatInput input)

@ -20,10 +20,10 @@ namespace NzbDrone.Core.CustomFormats
public override int Order => 8;
public override string ImplementationName => "Size";
[FieldDefinition(1, Label = "Minimum Size", HelpText = "Release must be greater than this size", Unit = "GB", Type = FieldType.Number)]
[FieldDefinition(1, Label = "CustomFormatsSpecificationMinimumSize", HelpText = "CustomFormatsSpecificationMinimumSizeHelpText", Unit = "GB", Type = FieldType.Number)]
public double Min { get; set; }
[FieldDefinition(1, Label = "Maximum Size", HelpText = "Release must be less than or equal to this size", Unit = "GB", Type = FieldType.Number)]
[FieldDefinition(1, Label = "CustomFormatsSpecificationMaximumSize", HelpText = "CustomFormatsSpecificationMaximumSizeHelpText", Unit = "GB", Type = FieldType.Number)]
public double Max { get; set; }
protected override bool IsSatisfiedByWithoutNegate(CustomFormatInput input)

@ -20,7 +20,7 @@ namespace NzbDrone.Core.CustomFormats
public override int Order => 5;
public override string ImplementationName => "Source";
[FieldDefinition(1, Label = "Source", Type = FieldType.Select, SelectOptions = typeof(QualitySource))]
[FieldDefinition(1, Label = "CustomFormatsSpecificationSource", Type = FieldType.Select, SelectOptions = typeof(QualitySource))]
public int Value { get; set; }
protected override bool IsSatisfiedByWithoutNegate(CustomFormatInput input)

@ -18,7 +18,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Plex
SeriesPlexMatchFile = true;
}
[FieldDefinition(0, Label = "Series Plex Match File", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Creates a .plexmatch file in the series folder")]
[FieldDefinition(0, Label = "MetadataPlexSettingsSeriesPlexMatchFile", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "MetadataPlexSettingsSeriesPlexMatchFileHelpText")]
public bool SeriesPlexMatchFile { get; set; }
public NzbDroneValidationResult Validate()

@ -21,16 +21,16 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Roksbox
EpisodeImages = true;
}
[FieldDefinition(0, Label = "Episode Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Season##\\filename.xml")]
[FieldDefinition(0, Label = "MetadataSettingsEpisodeMetadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Season##\\filename.xml")]
public bool EpisodeMetadata { get; set; }
[FieldDefinition(1, Label = "Series Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Series Title.jpg")]
[FieldDefinition(1, Label = "MetadataSettingsSeriesImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Series Title.jpg")]
public bool SeriesImages { get; set; }
[FieldDefinition(2, Label = "Season Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season ##.jpg")]
[FieldDefinition(2, Label = "MetadataSettingsSeasonImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season ##.jpg")]
public bool SeasonImages { get; set; }
[FieldDefinition(3, Label = "Episode Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\filename.jpg")]
[FieldDefinition(3, Label = "MetadataSettingsEpisodeImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\filename.jpg")]
public bool EpisodeImages { get; set; }
public bool IsValid => true;

@ -21,16 +21,16 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Wdtv
EpisodeImages = true;
}
[FieldDefinition(0, Label = "Episode Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Season##\\filename.xml")]
[FieldDefinition(0, Label = "MetadataSettingsEpisodeMetadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Season##\\filename.xml")]
public bool EpisodeMetadata { get; set; }
[FieldDefinition(1, Label = "Series Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "folder.jpg")]
[FieldDefinition(1, Label = "MetadataSettingsSeriesImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "folder.jpg")]
public bool SeriesImages { get; set; }
[FieldDefinition(2, Label = "Season Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\folder.jpg")]
[FieldDefinition(2, Label = "MetadataSettingsSeasonImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\folder.jpg")]
public bool SeasonImages { get; set; }
[FieldDefinition(3, Label = "Episode Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\filename.metathumb")]
[FieldDefinition(3, Label = "MetadataSettingsEpisodeImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\filename.metathumb")]
public bool EpisodeImages { get; set; }
public bool IsValid => true;

@ -24,28 +24,28 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
EpisodeImages = true;
}
[FieldDefinition(0, Label = "Series Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "tvshow.nfo with full series metadata")]
[FieldDefinition(0, Label = "MetadataSettingsSeriesMetadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "MetadataXmbcSettingsSeriesMetadataHelpText")]
public bool SeriesMetadata { get; set; }
[FieldDefinition(1, Label = "Series Metadata Episode Guide", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Include JSON formatted episode guide element in tvshow.nfo (Requires 'Series Metadata')", Advanced = true)]
[FieldDefinition(1, Label = "MetadataSettingsSeriesMetadataEpisodeGuide", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "MetadataXmbcSettingsSeriesMetadataEpisodeGuideHelpText", Advanced = true)]
public bool SeriesMetadataEpisodeGuide { get; set; }
[FieldDefinition(2, Label = "Series Metadata URL", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Include TheTVDB show URL in tvshow.nfo (can be combined with 'Series Metadata')", Advanced = true)]
[FieldDefinition(2, Label = "MetadataSettingsSeriesMetadataUrl", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "MetadataXmbcSettingsSeriesMetadataUrlHelpText", Advanced = true)]
public bool SeriesMetadataUrl { get; set; }
[FieldDefinition(3, Label = "Episode Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "<filename>.nfo")]
[FieldDefinition(3, Label = "MetadataSettingsEpisodeMetadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "<filename>.nfo")]
public bool EpisodeMetadata { get; set; }
[FieldDefinition(4, Label = "Episode Metadata Image Thumbs", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Include image thumb tags in <filename>.nfo (Requires 'Episode Metadata')", Advanced = true)]
[FieldDefinition(4, Label = "MetadataSettingsEpisodeMetadataImageThumbs", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "MetadataXmbcSettingsEpisodeMetadataImageThumbsHelpText", Advanced = true)]
public bool EpisodeImageThumb { get; set; }
[FieldDefinition(5, Label = "Series Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "fanart.jpg, poster.jpg, banner.jpg")]
[FieldDefinition(5, Label = "MetadataSettingsSeriesImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "fanart.jpg, poster.jpg, banner.jpg")]
public bool SeriesImages { get; set; }
[FieldDefinition(6, Label = "Season Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "season##-poster.jpg, season##-banner.jpg, season-specials-poster.jpg, season-specials-banner.jpg")]
[FieldDefinition(6, Label = "MetadataSettingsSeasonImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "season##-poster.jpg, season##-banner.jpg, season-specials-poster.jpg, season-specials-banner.jpg")]
public bool SeasonImages { get; set; }
[FieldDefinition(7, Label = "Episode Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "<filename>-thumb.jpg")]
[FieldDefinition(7, Label = "MetadataSettingsEpisodeImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "<filename>-thumb.jpg")]
public bool EpisodeImages { get; set; }
public bool IsValid => true;

@ -3,6 +3,7 @@ using System.Collections.Generic;
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@ -28,8 +29,9 @@ namespace NzbDrone.Core.ImportLists.AniList
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, importListStatusService, configService, parsingService, logger)
: base(httpClient, importListStatusService, configService, parsingService, localizationService, logger)
{
_importListRepository = netImportRepository;
}

@ -42,16 +42,16 @@ namespace NzbDrone.Core.ImportLists.AniList
public string BaseUrl { get; set; }
[FieldDefinition(0, Label = "Access Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsAccessToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public string AccessToken { get; set; }
[FieldDefinition(0, Label = "Refresh Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsRefreshToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public string RefreshToken { get; set; }
[FieldDefinition(0, Label = "Expires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsExpires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public DateTime Expires { get; set; }
[FieldDefinition(99, Label = "Authenticate with AniList", Type = FieldType.OAuth)]
[FieldDefinition(99, Label = "ImportListsAniListSettingsAuthenticateWithAniList", Type = FieldType.OAuth)]
public string SignIn { get; set; }
public NzbDroneValidationResult Validate()

@ -9,6 +9,7 @@ using NzbDrone.Core.Configuration;
using NzbDrone.Core.Http.CloudFlare;
using NzbDrone.Core.ImportLists.Exceptions;
using NzbDrone.Core.Indexers.Exceptions;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
@ -21,12 +22,13 @@ namespace NzbDrone.Core.ImportLists.AniList.List
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(netImportRepository, httpClient, importListStatusService, configService, parsingService, logger)
: base(netImportRepository, httpClient, importListStatusService, configService, parsingService, localizationService, logger)
{
}
public override string Name => "AniList List";
public override string Name => _localizationService.GetLocalizedString("TypeOfList", new Dictionary<string, object> { { "typeOfList", "AniList" } });
public override AniListRequestGenerator GetRequestGenerator()
{

@ -31,40 +31,40 @@ namespace NzbDrone.Core.ImportLists.AniList.List
protected override AbstractValidator<AniListSettings> Validator => new AniListSettingsValidator();
[FieldDefinition(1, Label = "Username", HelpText = "Username for the List to import from")]
[FieldDefinition(1, Label = "Username", HelpText = "ImportListsAniListSettingsUsernameHelpText")]
public string Username { get; set; }
[FieldDefinition(2, Label = "Import Watching", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Currently Watching")]
[FieldDefinition(2, Label = "ImportListsAniListSettingsImportWatching", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportWatchingHelpText")]
public bool ImportCurrent { get; set; }
[FieldDefinition(3, Label = "Import Planning", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Planning to Watch")]
[FieldDefinition(3, Label = "ImportListsAniListSettingsImportPlanning", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportPlanningHelpText")]
public bool ImportPlanning { get; set; }
[FieldDefinition(4, Label = "Import Completed", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Completed Watching")]
[FieldDefinition(4, Label = "ImportListsAniListSettingsImportCompleted", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportCompletedHelpText")]
public bool ImportCompleted { get; set; }
[FieldDefinition(5, Label = "Import Dropped", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Dropped")]
[FieldDefinition(5, Label = "ImportListsAniListSettingsImportDropped", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportDroppedHelpText")]
public bool ImportDropped { get; set; }
[FieldDefinition(6, Label = "Import Paused", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: On Hold")]
[FieldDefinition(6, Label = "ImportListsAniListSettingsImportPaused", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportPausedHelpText")]
public bool ImportPaused { get; set; }
[FieldDefinition(7, Label = "Import Repeating", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Currently Rewatching")]
[FieldDefinition(7, Label = "ImportListsAniListSettingsImportRepeating", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportRepeatingHelpText")]
public bool ImportRepeating { get; set; }
[FieldDefinition(8, Label = "Import Finished", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: All episodes have aired")]
[FieldDefinition(8, Label = "ImportListsAniListSettingsImportFinished", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportFinishedHelpText")]
public bool ImportFinished { get; set; }
[FieldDefinition(9, Label = "Import Releasing", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: Currently airing new episodes")]
[FieldDefinition(9, Label = "ImportListsAniListSettingsImportReleasing", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportReleasingHelpText")]
public bool ImportReleasing { get; set; }
[FieldDefinition(10, Label = "Import Not Yet Released", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: Airing has not yet started")]
[FieldDefinition(10, Label = "ImportListsAniListSettingsImportNotYetReleased", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportNotYetReleasedHelpText")]
public bool ImportUnreleased { get; set; }
[FieldDefinition(11, Label = "Import Cancelled", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: Series is cancelled")]
[FieldDefinition(11, Label = "ImportListsAniListSettingsImportCancelled", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportCancelledHelpText")]
public bool ImportCancelled { get; set; }
[FieldDefinition(12, Label = "Import Hiatus", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: Series on Hiatus")]
[FieldDefinition(12, Label = "ImportListsAniListSettingsImportHiatus", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportHiatusHelpText")]
public bool ImportHiatus { get; set; }
}
}

@ -4,6 +4,7 @@ using FluentValidation.Results;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
@ -12,7 +13,7 @@ namespace NzbDrone.Core.ImportLists.Custom
public class CustomImport : ImportListBase<CustomSettings>
{
private readonly ICustomImportProxy _customProxy;
public override string Name => "Custom List";
public override string Name => _localizationService.GetLocalizedString("ImportListsCustomListSettingsName");
public override TimeSpan MinRefreshInterval => TimeSpan.FromHours(6);
@ -22,8 +23,9 @@ namespace NzbDrone.Core.ImportLists.Custom
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(importListStatusService, configService, parsingService, logger)
: base(importListStatusService, configService, parsingService, localizationService, logger)
{
_customProxy = customProxy;
}

@ -10,6 +10,7 @@ using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Localization;
namespace NzbDrone.Core.ImportLists.Custom
{
@ -22,11 +23,13 @@ namespace NzbDrone.Core.ImportLists.Custom
public class CustomImportProxy : ICustomImportProxy
{
private readonly IHttpClient _httpClient;
private readonly ILocalizationService _localizationService;
private readonly Logger _logger;
public CustomImportProxy(IHttpClient httpClient, Logger logger)
public CustomImportProxy(IHttpClient httpClient, ILocalizationService localizationService, Logger logger)
{
_httpClient = httpClient;
_localizationService = localizationService;
_logger = logger;
}
@ -46,16 +49,16 @@ namespace NzbDrone.Core.ImportLists.Custom
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized)
{
_logger.Error(ex, "There was an authorization issue. We cannot get the list from the provider.");
return new ValidationFailure("BaseUrl", "It seems we are unauthorized to make this request.");
return new ValidationFailure("BaseUrl", _localizationService.GetLocalizedString("ImportListsCustomListValidationAuthenticationFailure"));
}
_logger.Error(ex, "Unable to connect to import list.");
return new ValidationFailure("BaseUrl", $"We are unable to make the request to that URL. StatusCode: {ex.Response.StatusCode}");
return new ValidationFailure("BaseUrl", _localizationService.GetLocalizedString("ImportListsCustomListValidationConnectionError", new Dictionary<string, object> { { "exceptionStatusCode", ex.Response.StatusCode } }));
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to connect to import list.");
return new ValidationFailure(string.Empty, $"Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details.");
return new ValidationFailure(string.Empty, _localizationService.GetLocalizedString("ImportListsValidationUnableToConnectException", new Dictionary<string, object> { { "exceptionMessage", ex.Message } }));
}
return null;

@ -22,7 +22,7 @@ namespace NzbDrone.Core.ImportLists.Custom
BaseUrl = "";
}
[FieldDefinition(0, Label = "List URL", HelpText = "The URL for the series list")]
[FieldDefinition(0, Label = "ImportListsCustomListSettingsUrl", HelpText = "ImportListsCustomListSettingsUrlHelpText")]
public string BaseUrl { get; set; }
public NzbDroneValidationResult Validate()

@ -10,6 +10,7 @@ using NzbDrone.Core.Configuration;
using NzbDrone.Core.Http.CloudFlare;
using NzbDrone.Core.ImportLists.Exceptions;
using NzbDrone.Core.Indexers.Exceptions;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@ -31,8 +32,8 @@ namespace NzbDrone.Core.ImportLists
public abstract IImportListRequestGenerator GetRequestGenerator();
public abstract IParseImportListResponse GetParser();
public HttpImportListBase(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
: base(importListStatusService, configService, parsingService, logger)
public HttpImportListBase(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, ILocalizationService localizationService, Logger logger)
: base(importListStatusService, configService, parsingService, localizationService, logger)
{
_httpClient = httpClient;
}

@ -3,6 +3,7 @@ using System.Collections.Generic;
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.ThingiProvider;
@ -10,7 +11,7 @@ namespace NzbDrone.Core.ImportLists.Imdb
{
public class ImdbListImport : HttpImportListBase<ImdbListSettings>
{
public override string Name => "IMDb Lists";
public override string Name => _localizationService.GetLocalizedString("TypeOfList", new Dictionary<string, object> { { "typeOfList", "IMDb" } });
public override ImportListType ListType => ImportListType.Other;
public override TimeSpan MinRefreshInterval => TimeSpan.FromHours(12);
@ -19,8 +20,9 @@ namespace NzbDrone.Core.ImportLists.Imdb
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, importListStatusService, configService, parsingService, logger)
: base(httpClient, importListStatusService, configService, parsingService, localizationService, logger)
{
}

@ -20,7 +20,7 @@ namespace NzbDrone.Core.ImportLists.Imdb
public string BaseUrl { get; set; }
[FieldDefinition(1, Label = "List ID", HelpText = "IMDb list ID (e.g ls12345678)")]
[FieldDefinition(1, Label = "ImportListsImdbSettingsListId", HelpText = "ImportListsImdbSettingsListIdHelpText")]
public string ListId { get; set; }
public NzbDroneValidationResult Validate()

@ -4,6 +4,7 @@ using System.Linq;
using FluentValidation.Results;
using NLog;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
@ -16,6 +17,7 @@ namespace NzbDrone.Core.ImportLists
protected readonly IImportListStatusService _importListStatusService;
protected readonly IConfigService _configService;
protected readonly IParsingService _parsingService;
protected readonly ILocalizationService _localizationService;
protected readonly Logger _logger;
public abstract string Name { get; }
@ -24,11 +26,12 @@ namespace NzbDrone.Core.ImportLists
public abstract TimeSpan MinRefreshInterval { get; }
public ImportListBase(IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
public ImportListBase(IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, ILocalizationService localizationService, Logger logger)
{
_importListStatusService = importListStatusService;
_configService = configService;
_parsingService = parsingService;
_localizationService = localizationService;
_logger = logger;
}
@ -86,7 +89,7 @@ namespace NzbDrone.Core.ImportLists
catch (Exception ex)
{
_logger.Error(ex, "Test aborted due to exception");
failures.Add(new ValidationFailure(string.Empty, "Test was aborted due to an error: " + ex.Message));
failures.Add(new ValidationFailure(string.Empty, _localizationService.GetLocalizedString("ImportListsValidationTestFailed", new Dictionary<string, object> { { "exceptionMessage", ex.Message } })));
}
return new ValidationResult(failures);

@ -5,6 +5,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Exceptions;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Notifications.Plex.PlexTv;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
@ -24,13 +25,14 @@ namespace NzbDrone.Core.ImportLists.Plex
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, importListStatusService, configService, parsingService, logger)
: base(httpClient, importListStatusService, configService, parsingService, localizationService, logger)
{
_plexTvService = plexTvService;
}
public override string Name => "Plex Watchlist";
public override string Name => _localizationService.GetLocalizedString("ImportListsPlexSettingsWatchlistName");
public override int PageSize => 50;
public override IList<ImportListItemInfo> Fetch()

@ -27,10 +27,10 @@ namespace NzbDrone.Core.ImportLists.Plex
public string BaseUrl { get; set; }
[FieldDefinition(0, Label = "Access Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsAccessToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public string AccessToken { get; set; }
[FieldDefinition(99, Label = "Authenticate with Plex.tv", Type = FieldType.OAuth)]
[FieldDefinition(99, Label = "ImportListsPlexSettingsAuthenticateWithPlex", Type = FieldType.OAuth)]
public string SignIn { get; set; }
public NzbDroneValidationResult Validate()

@ -2,13 +2,14 @@ using System;
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
namespace NzbDrone.Core.ImportLists.Rss.Plex
{
public class PlexRssImport : RssImportBase<PlexRssImportSettings>
{
public override string Name => "Plex Watchlist RSS";
public override string Name => _localizationService.GetLocalizedString("ImportListsPlexSettingsWatchlistRSSName");
public override ImportListType ListType => ImportListType.Plex;
public override TimeSpan MinRefreshInterval => TimeSpan.FromHours(6);
@ -16,8 +17,9 @@ namespace NzbDrone.Core.ImportLists.Rss.Plex
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, importListStatusService, configService, parsingService, logger)
: base(httpClient, importListStatusService, configService, parsingService, localizationService, logger)
{
}

@ -16,7 +16,7 @@ namespace NzbDrone.Core.ImportLists.Rss.Plex
{
private PlexRssImportSettingsValidator Validator => new ();
[FieldDefinition(0, Label = "Url", Type = FieldType.Textbox, HelpLink = "https://app.plex.tv/desktop/#!/settings/watchlist")]
[FieldDefinition(0, Label = "ImportListsSettingsRssUrl", Type = FieldType.Textbox, HelpLink = "https://app.plex.tv/desktop/#!/settings/watchlist")]
public override string Url { get; set; }
public override NzbDroneValidationResult Validate()

@ -3,6 +3,7 @@ using System.Collections.Generic;
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
@ -19,8 +20,9 @@ namespace NzbDrone.Core.ImportLists.Rss
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, importListStatusService, configService, parsingService, logger)
: base(httpClient, importListStatusService, configService, parsingService, localizationService, logger)
{
}

@ -18,7 +18,7 @@ namespace NzbDrone.Core.ImportLists.Rss
public string BaseUrl { get; set; }
[FieldDefinition(0, Label = "Url", Type = FieldType.Textbox)]
[FieldDefinition(0, Label = "ImportListsSettingsRssUrl", Type = FieldType.Textbox)]
public virtual string Url { get; set; }
public virtual NzbDroneValidationResult Validate()

@ -4,6 +4,7 @@ using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@ -28,8 +29,9 @@ namespace NzbDrone.Core.ImportLists.Simkl
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, importListStatusService, configService, parsingService, logger)
: base(httpClient, importListStatusService, configService, parsingService, localizationService, logger)
{
_importListRepository = netImportRepository;
}

@ -37,19 +37,19 @@ namespace NzbDrone.Core.ImportLists.Simkl
public string BaseUrl { get; set; }
[FieldDefinition(0, Label = "Access Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsAccessToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public string AccessToken { get; set; }
[FieldDefinition(0, Label = "Refresh Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsRefreshToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public string RefreshToken { get; set; }
[FieldDefinition(0, Label = "Expires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsExpires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public DateTime Expires { get; set; }
[FieldDefinition(0, Label = "Auth User", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsAuthUser", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public string AuthUser { get; set; }
[FieldDefinition(99, Label = "Authenticate with Simkl", Type = FieldType.OAuth)]
[FieldDefinition(99, Label = "ImportListsSimklSettingsAuthenticatewithSimkl", Type = FieldType.OAuth)]
public string SignIn { get; set; }
public NzbDroneValidationResult Validate()

@ -1,6 +1,7 @@
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
namespace NzbDrone.Core.ImportLists.Simkl.User
@ -12,12 +13,13 @@ namespace NzbDrone.Core.ImportLists.Simkl.User
IImportListStatusService netImportStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, logger)
: base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, localizationService, logger)
{
}
public override string Name => "Simkl User Watchlist";
public override string Name => _localizationService.GetLocalizedString("ImportListsSimklSettingsName");
public override IImportListRequestGenerator GetRequestGenerator()
{

@ -1,18 +1,18 @@
using System.Runtime.Serialization;
using NzbDrone.Core.Annotations;
namespace NzbDrone.Core.ImportLists.Simkl.User
{
public enum SimklUserListType
{
[EnumMember(Value = "Watching")]
[FieldOption(Label = "ImportListsSimklSettingsUserListTypeWatching")]
Watching = 0,
[EnumMember(Value = "Plan To Watch")]
[FieldOption(Label = "ImportListsSimklSettingsUserListTypePlanToWatch")]
PlanToWatch = 1,
[EnumMember(Value = "Hold")]
[FieldOption(Label = "ImportListsSimklSettingsUserListTypeHold")]
Hold = 2,
[EnumMember(Value = "Completed")]
[FieldOption(Label = "ImportListsSimklSettingsUserListTypeCompleted")]
Completed = 3,
[EnumMember(Value = "Dropped")]
[FieldOption(Label = "ImportListsSimklSettingsUserListTypeDropped")]
Dropped = 4
}
}

@ -22,10 +22,10 @@ namespace NzbDrone.Core.ImportLists.Simkl.User
ShowType = (int)SimklUserShowType.Shows;
}
[FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(SimklUserListType), HelpText = "Type of list you're seeking to import from")]
[FieldDefinition(1, Label = "ImportListsSimklSettingsListType", Type = FieldType.Select, SelectOptions = typeof(SimklUserListType), HelpText = "ImportListsSimklSettingsListTypeHelpText")]
public int ListType { get; set; }
[FieldDefinition(1, Label = "Show Type", Type = FieldType.Select, SelectOptions = typeof(SimklUserShowType), HelpText = "Type of show you're seeking to import from")]
[FieldDefinition(1, Label = "ImportListsSimklSettingsShowType", Type = FieldType.Select, SelectOptions = typeof(SimklUserShowType), HelpText = "ImportListsSimklSettingsShowTypeHelpText")]
public int ShowType { get; set; }
}
}

@ -5,6 +5,7 @@ using FluentValidation.Results;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@ -23,8 +24,9 @@ namespace NzbDrone.Core.ImportLists.Sonarr
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(importListStatusService, configService, parsingService, logger)
: base(importListStatusService, configService, parsingService, localizationService, logger)
{
_sonarrV3Proxy = sonarrV3Proxy;
}

@ -29,22 +29,23 @@ namespace NzbDrone.Core.ImportLists.Sonarr
RootFolderPaths = Array.Empty<string>();
}
[FieldDefinition(0, Label = "Full URL", HelpText = "URL, including port, of the Sonarr instance to import from")]
[FieldDefinition(0, Label = "ImportListsSonarrSettingsFullUrl", HelpText = "ImportListsSonarrSettingsFullUrlHelpText")]
public string BaseUrl { get; set; }
[FieldDefinition(1, Label = "API Key", HelpText = "Apikey of the Sonarr instance to import from")]
[FieldDefinition(1, Label = "ApiKey", HelpText = "ImportListsSonarrSettingsApiKeyHelpText")]
public string ApiKey { get; set; }
[FieldDefinition(2, Type = FieldType.Select, SelectOptionsProviderAction = "getProfiles", Label = "Quality Profiles", HelpText = "Quality Profiles from the source instance to import from")]
[FieldDefinition(2, Type = FieldType.Select, SelectOptionsProviderAction = "getProfiles", Label = "QualityProfiles", HelpText = "ImportListsSonarrSettingsQualityProfilesHelpText")]
public IEnumerable<int> ProfileIds { get; set; }
// TODO: Remove this eventually, no translation added as deprecated
[FieldDefinition(3, Type = FieldType.Select, SelectOptionsProviderAction = "getLanguageProfiles", Label = "Language Profiles", HelpText = "Language Profiles from the source instance to import from")]
public IEnumerable<int> LanguageProfileIds { get; set; }
[FieldDefinition(4, Type = FieldType.Select, SelectOptionsProviderAction = "getTags", Label = "Tags", HelpText = "Tags from the source instance to import from")]
[FieldDefinition(4, Type = FieldType.Select, SelectOptionsProviderAction = "getTags", Label = "Tags", HelpText = "ImportListsSonarrSettingsTagsHelpText")]
public IEnumerable<int> TagIds { get; set; }
[FieldDefinition(5, Type = FieldType.Select, SelectOptionsProviderAction = "getRootFolders", Label = "Root Folders", HelpText = "Root Folders from the source instance to import from")]
[FieldDefinition(5, Type = FieldType.Select, SelectOptionsProviderAction = "getRootFolders", Label = "RootFolders", HelpText = "ImportListsSonarrSettingsRootFoldersHelpText")]
public IEnumerable<string> RootFolderPaths { get; set; }
public NzbDroneValidationResult Validate()

@ -6,6 +6,7 @@ using Newtonsoft.Json;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Localization;
namespace NzbDrone.Core.ImportLists.Sonarr
{
@ -23,10 +24,12 @@ namespace NzbDrone.Core.ImportLists.Sonarr
{
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
private readonly ILocalizationService _localizationService;
public SonarrV3Proxy(IHttpClient httpClient, Logger logger)
public SonarrV3Proxy(IHttpClient httpClient, ILocalizationService localizationService, Logger logger)
{
_httpClient = httpClient;
_localizationService = localizationService;
_logger = logger;
}
@ -66,22 +69,22 @@ namespace NzbDrone.Core.ImportLists.Sonarr
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized)
{
_logger.Error(ex, "API Key is invalid");
return new ValidationFailure("ApiKey", "API Key is invalid");
return new ValidationFailure("ApiKey", _localizationService.GetLocalizedString("ImportListsValidationInvalidApiKey"));
}
if (ex.Response.HasHttpRedirect)
{
_logger.Error(ex, "Sonarr returned redirect and is invalid");
return new ValidationFailure("BaseUrl", "Sonarr URL is invalid, are you missing a URL base?");
return new ValidationFailure("BaseUrl", _localizationService.GetLocalizedString("ImportListsSonarrValidationInvalidUrl"));
}
_logger.Error(ex, "Unable to connect to import list.");
return new ValidationFailure(string.Empty, $"Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details.");
return new ValidationFailure(string.Empty, _localizationService.GetLocalizedString("ImportListsValidationUnableToConnectException", new Dictionary<string, object> { { "exceptionMessage", ex.Message } }));
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to connect to import list.");
return new ValidationFailure(string.Empty, $"Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details.");
return new ValidationFailure(string.Empty, _localizationService.GetLocalizedString("ImportListsValidationUnableToConnectException", new Dictionary<string, object> { { "exceptionMessage", ex.Message } }));
}
return null;

@ -1,6 +1,8 @@
using System.Collections.Generic;
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
namespace NzbDrone.Core.ImportLists.Trakt.List
@ -12,12 +14,13 @@ namespace NzbDrone.Core.ImportLists.Trakt.List
IImportListStatusService netImportStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, logger)
: base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, localizationService, logger)
{
}
public override string Name => "Trakt List";
public override string Name => _localizationService.GetLocalizedString("TypeOfList", new Dictionary<string, object> { { "typeOfList", "Trakt" } });
public override IImportListRequestGenerator GetRequestGenerator()
{

@ -17,10 +17,10 @@ namespace NzbDrone.Core.ImportLists.Trakt.List
{
protected override AbstractValidator<TraktListSettings> Validator => new TraktListSettingsValidator();
[FieldDefinition(1, Label = "Username", HelpText = "Username for the List to import from")]
[FieldDefinition(1, Label = "Username", HelpText = "ImportListsTraktSettingsUsernameHelpText")]
public string Username { get; set; }
[FieldDefinition(2, Label = "List Name", HelpText = "List name for import, list must be public or you must have access to the list")]
[FieldDefinition(2, Label = "ImportListsTraktSettingsListName", HelpText = "ImportListsTraktSettingsListNameHelpText")]
public string Listname { get; set; }
}
}

@ -1,6 +1,7 @@
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
namespace NzbDrone.Core.ImportLists.Trakt.Popular
@ -12,12 +13,13 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular
IImportListStatusService netImportStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, logger)
: base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, localizationService, logger)
{
}
public override string Name => "Trakt Popular List";
public override string Name => _localizationService.GetLocalizedString("ImportListsTraktSettingsPopularName");
public override IParseImportListResponse GetParser()
{

@ -1,31 +1,30 @@
using System.Runtime.Serialization;
using NzbDrone.Core.Annotations;
namespace NzbDrone.Core.ImportLists.Trakt.Popular
{
public enum TraktPopularListType
{
[EnumMember(Value = "Trending Shows")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTrendingShows")]
Trending = 0,
[EnumMember(Value = "Popular Shows")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypePopularShows")]
Popular = 1,
[EnumMember(Value = "Anticipated Shows")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeAnticipatedShows")]
Anticipated = 2,
[EnumMember(Value = "Top Watched Shows By Week")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopWeekShows")]
TopWatchedByWeek = 3,
[EnumMember(Value = "Top Watched Shows By Month")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopMonthShows")]
TopWatchedByMonth = 4,
[EnumMember(Value = "Top Watched Shows By Year")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopYearShows")]
TopWatchedByYear = 5,
[EnumMember(Value = "Top Watched Shows Of All Time")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopAllTimeShows")]
TopWatchedByAllTime = 6,
[EnumMember(Value = "Recommended Shows By Week")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedWeekShows")]
RecommendedByWeek = 7,
[EnumMember(Value = "Recommended Shows By Month")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedMonthShows")]
RecommendedByMonth = 8,
[EnumMember(Value = "Recommended Shows By Year")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedYearShows")]
RecommendedByYear = 9,
[EnumMember(Value = "Recommended Shows Of All Time")]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedAllTimeShows")]
RecommendedByAllTime = 10
}
}

@ -35,16 +35,16 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular
TraktListType = (int)TraktPopularListType.Popular;
}
[FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(TraktPopularListType), HelpText = "Type of list you're seeking to import from")]
[FieldDefinition(1, Label = "ImportListsTraktSettingsListType", Type = FieldType.Select, SelectOptions = typeof(TraktPopularListType), HelpText = "ImportListsTraktSettingsListTypeHelpText")]
public int TraktListType { get; set; }
[FieldDefinition(2, Label = "Rating", HelpText = "Filter series by rating range (0-100)")]
[FieldDefinition(2, Label = "ImportListsTraktSettingsRating", HelpText = "ImportListsTraktSettingsRatingHelpText")]
public string Rating { get; set; }
[FieldDefinition(4, Label = "Genres", HelpText = "Filter series by Trakt Genre Slug (Comma Separated) Only for Popular Lists")]
[FieldDefinition(4, Label = "ImportListsTraktSettingsGenres", HelpText = "ImportListsTraktSettingsGenresHelpText")]
public string Genres { get; set; }
[FieldDefinition(5, Label = "Years", HelpText = "Filter series by year or year range")]
[FieldDefinition(5, Label = "ImportListsTraktSettingsYears", HelpText = "ImportListsTraktSettingsYearsHelpText")]
public string Years { get; set; }
}
}

@ -4,6 +4,7 @@ using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@ -28,8 +29,9 @@ namespace NzbDrone.Core.ImportLists.Trakt
IImportListStatusService importListStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, importListStatusService, configService, parsingService, logger)
: base(httpClient, importListStatusService, configService, parsingService, localizationService, logger)
{
_importListRepository = netImportRepository;
}

@ -48,25 +48,25 @@ namespace NzbDrone.Core.ImportLists.Trakt
public string BaseUrl { get; set; }
[FieldDefinition(0, Label = "Access Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsAccessToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public string AccessToken { get; set; }
[FieldDefinition(0, Label = "Refresh Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsRefreshToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public string RefreshToken { get; set; }
[FieldDefinition(0, Label = "Expires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsExpires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public DateTime Expires { get; set; }
[FieldDefinition(0, Label = "Auth User", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
[FieldDefinition(0, Label = "ImportListsSettingsAuthUser", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]
public string AuthUser { get; set; }
[FieldDefinition(5, Label = "Limit", HelpText = "Limit the number of series to get")]
[FieldDefinition(5, Label = "ImportListsTraktSettingsLimit", HelpText = "ImportListsTraktSettingsLimitHelpText")]
public int Limit { get; set; }
[FieldDefinition(6, Label = "Additional Parameters", HelpText = "Additional Trakt API parameters", Advanced = true)]
[FieldDefinition(6, Label = "ImportListsTraktSettingsAdditionalParameters", HelpText = "ImportListsTraktSettingsAdditionalParametersHelpText", Advanced = true)]
public string TraktAdditionalParameters { get; set; }
[FieldDefinition(99, Label = "Authenticate with Trakt", Type = FieldType.OAuth)]
[FieldDefinition(99, Label = "ImportListsTraktSettingsAuthenticateWithTrakt", Type = FieldType.OAuth)]
public string SignIn { get; set; }
public NzbDroneValidationResult Validate()

@ -1,6 +1,7 @@
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
namespace NzbDrone.Core.ImportLists.Trakt.User
@ -12,12 +13,13 @@ namespace NzbDrone.Core.ImportLists.Trakt.User
IImportListStatusService netImportStatusService,
IConfigService configService,
IParsingService parsingService,
ILocalizationService localizationService,
Logger logger)
: base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, logger)
: base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, localizationService, logger)
{
}
public override string Name => "Trakt User";
public override string Name => _localizationService.GetLocalizedString("ImportListsTraktSettingsUserListName");
public override IParseImportListResponse GetParser()
{

@ -4,11 +4,11 @@ namespace NzbDrone.Core.ImportLists.Trakt.User
{
public enum TraktUserListType
{
[FieldOption(Label = "User Watch List")]
[FieldOption(Label = "ImportListsTraktSettingsUserListTypeWatch")]
UserWatchList = 0,
[FieldOption(Label = "User Watched List")]
[FieldOption(Label = "ImportListsTraktSettingsUserListTypeWatched")]
UserWatchedList = 1,
[FieldOption(Label = "User Collection List")]
[FieldOption(Label = "ImportListsTraktSettingsUserListTypeCollection")]
UserCollectionList = 2
}
}

@ -25,16 +25,16 @@ namespace NzbDrone.Core.ImportLists.Trakt.User
TraktWatchSorting = (int)TraktUserWatchSorting.Rank;
}
[FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(TraktUserListType), HelpText = "Type of list you're seeking to import from")]
[FieldDefinition(1, Label = "ImportListsTraktSettingsListType", Type = FieldType.Select, SelectOptions = typeof(TraktUserListType), HelpText = "ImportListsTraktSettingsListTypeHelpText")]
public int TraktListType { get; set; }
[FieldDefinition(2, Label = "Watched List Filter", Type = FieldType.Select, SelectOptions = typeof(TraktUserWatchedListType), HelpText = "If List Type is Watched. Series do you want to import from")]
[FieldDefinition(2, Label = "ImportListsTraktSettingsWatchedListFilter", Type = FieldType.Select, SelectOptions = typeof(TraktUserWatchedListType), HelpText = "ImportListsTraktSettingsWatchedListFilterHelpText")]
public int TraktWatchedListType { get; set; }
[FieldDefinition(3, Label = "Watch List Sorting", Type = FieldType.Select, SelectOptions = typeof(TraktUserWatchSorting), HelpText = "If List Type is Watch")]
[FieldDefinition(3, Label = "ImportListsTraktSettingsWatchedListSorting", Type = FieldType.Select, SelectOptions = typeof(TraktUserWatchSorting), HelpText = "ImportListsTraktSettingsWatchedListSortingHelpText")]
public int TraktWatchSorting { get; set; }
[FieldDefinition(4, Label = "Username", HelpText = "Username for the List to import from (empty to use Auth User)")]
[FieldDefinition(4, Label = "Username", HelpText = "ImportListsTraktSettingsUserListUsernameHelpText")]
public string Username { get; set; }
}

@ -4,11 +4,11 @@ namespace NzbDrone.Core.ImportLists.Trakt.User
{
public enum TraktUserWatchedListType
{
[FieldOption(Label = "All")]
[FieldOption(Label = "ImportListsTraktSettingsWatchedListTypeAll")]
All = 0,
[FieldOption(Label = "In Progress")]
[FieldOption(Label = "ImportListsTraktSettingsWatchedListTypeInProgress")]
InProgress = 1,
[FieldOption(Label = "100% Watched")]
[FieldOption(Label = "ImportListsTraktSettingsWatchedListTypeCompleted")]
CompletelyWatched = 2
}
}

@ -127,6 +127,14 @@
"AutoTaggingLoadError": "Unable to load auto tagging",
"AutoTaggingNegateHelpText": "If checked, the auto tagging rule will not apply if this {implementationName} condition matches.",
"AutoTaggingRequiredHelpText": "This {implementationName} condition must match for the auto tagging rule to apply. Otherwise a single {implementationName} match is sufficient.",
"AutoTaggingSpecificationGenre": "Genre(s)",
"AutoTaggingSpecificationMaximumYear": "Maximum Year",
"AutoTaggingSpecificationMinimumYear": "Minimum Year",
"AutoTaggingSpecificationOriginalLanguage": "Language",
"AutoTaggingSpecificationQualityProfile": "Quality Profile",
"AutoTaggingSpecificationRootFolder": "Root Folder",
"AutoTaggingSpecificationSeriesType": "Series Type",
"AutoTaggingSpecificationStatus": "Status",
"Automatic": "Automatic",
"AutomaticAdd": "Automatic Add",
"AutomaticSearch": "Automatic Search",
@ -257,6 +265,16 @@
"CustomFormatsLoadError": "Unable to load Custom Formats",
"CustomFormatsSettings": "Custom Formats Settings",
"CustomFormatsSettingsSummary": "Custom Formats and Settings",
"CustomFormatsSpecificationLanguage": "Language",
"CustomFormatsSpecificationMaximumSize": "Maximum Size",
"CustomFormatsSpecificationMaximumSizeHelpText": "Release must be less than or equal to this size",
"CustomFormatsSpecificationMinimumSize": "Minimum Size",
"CustomFormatsSpecificationMinimumSizeHelpText": "Release must be greater than this size",
"CustomFormatsSpecificationRegularExpression": "Language",
"CustomFormatsSpecificationRegularExpressionHelpText": "Custom Format RegEx is Case Insensitive",
"CustomFormatsSpecificationReleaseGroup": "Release Group",
"CustomFormatsSpecificationResolution": "Resolution",
"CustomFormatsSpecificationSource": "Source",
"Cutoff": "Cutoff",
"CutoffUnmet": "Cutoff Unmet",
"CutoffUnmetLoadError": "Error loading cutoff unmet items",
@ -759,8 +777,108 @@
"ImportListStatusAllUnavailableHealthCheckMessage": "All lists are unavailable due to failures",
"ImportListStatusUnavailableHealthCheckMessage": "Lists unavailable due to failures: {importListNames}",
"ImportLists": "Import Lists",
"ImportListsAniListSettingsAuthenticateWithAniList": "Authenticate with AniList",
"ImportListsAniListSettingsImportCancelled": "Import Cancelled",
"ImportListsAniListSettingsImportCancelledHelpText": "Media: Series is cancelled",
"ImportListsAniListSettingsImportCompleted": "Import Completed",
"ImportListsAniListSettingsImportCompletedHelpText": "List: Completed Watching",
"ImportListsAniListSettingsImportDropped": "Import Dropped",
"ImportListsAniListSettingsImportDroppedHelpText": "List: Dropped",
"ImportListsAniListSettingsImportFinished": "Import Finished",
"ImportListsAniListSettingsImportFinishedHelpText": "Media: All episodes have aired",
"ImportListsAniListSettingsImportHiatus": "Import Hiatus",
"ImportListsAniListSettingsImportHiatusHelpText": "Media: Series on Hiatus",
"ImportListsAniListSettingsImportNotYetReleased": "Import Not Yet Released",
"ImportListsAniListSettingsImportNotYetReleasedHelpText": "Media: Airing has not yet started",
"ImportListsAniListSettingsImportPaused": "Import Paused",
"ImportListsAniListSettingsImportPausedHelpText": "List: On Hold",
"ImportListsAniListSettingsImportPlanning": "Import Planning",
"ImportListsAniListSettingsImportPlanningHelpText": "List: Planning to Watch",
"ImportListsAniListSettingsImportReleasing": "Import Releasing",
"ImportListsAniListSettingsImportReleasingHelpText": "Media: Currently airing new episodes",
"ImportListsAniListSettingsImportRepeating": "Import Repeating",
"ImportListsAniListSettingsImportRepeatingHelpText": "List: Currently Re-watching",
"ImportListsAniListSettingsImportWatching": "Import Watching",
"ImportListsAniListSettingsImportWatchingHelpText": "List: Currently Watching",
"ImportListsAniListSettingsUsernameHelpText": "Username for the List to import from",
"ImportListsCustomListSettingsName": "Custom List",
"ImportListsCustomListSettingsUrl": "List URL",
"ImportListsCustomListSettingsUrlHelpText": "The URL for the series list",
"ImportListsCustomListValidationAuthenticationFailure": "Authentication Failure",
"ImportListsCustomListValidationConnectionError": "Unable to make the request to that URL. StatusCode: {exceptionStatusCode}",
"ImportListsImdbSettingsListId": "List ID",
"ImportListsImdbSettingsListIdHelpText": "IMDb list ID (e.g ls12345678)",
"ImportListsLoadError": "Unable to load Import Lists",
"ImportListsPlexSettingsAuthenticateWithPlex": "Authenticate with Plex.tv",
"ImportListsPlexSettingsWatchlistName": "Plex Watchlist",
"ImportListsPlexSettingsWatchlistRSSName": "Plex Watchlist RSS",
"ImportListsSettingsAccessToken": "Access Token",
"ImportListsSettingsAuthUser": "Auth User",
"ImportListsSettingsExpires": "Expires",
"ImportListsSettingsRefreshToken": "Refresh Token",
"ImportListsSettingsRssUrl": "RSS URL",
"ImportListsSettingsSummary": "Import from another {appName} instance or Trakt lists and manage list exclusions",
"ImportListsSimklSettingsAuthenticatewithSimkl": "Authenticate with Simkl",
"ImportListsSimklSettingsListType": "List Type",
"ImportListsSimklSettingsListTypeHelpText": "Type of list you're seeking to import from",
"ImportListsSimklSettingsName": "Simkl User Watchlist",
"ImportListsSimklSettingsShowType": "Show Type",
"ImportListsSimklSettingsShowTypeHelpText": "Type of show you're seeking to import from",
"ImportListsSimklSettingsUserListTypeCompleted": "Completed",
"ImportListsSimklSettingsUserListTypeDropped": "Dropped",
"ImportListsSimklSettingsUserListTypeHold": "Hold",
"ImportListsSimklSettingsUserListTypePlanToWatch": "Plan To Watch",
"ImportListsSimklSettingsUserListTypeWatching": "Watching",
"ImportListsSonarrSettingsApiKeyHelpText": "API Key of the {appName} instance to import from",
"ImportListsSonarrSettingsFullUrl": "Full URL",
"ImportListsSonarrSettingsFullUrlHelpText": "URL, including port, of the {appName} instance to import from",
"ImportListsSonarrSettingsQualityProfilesHelpText": "Quality Profiles from the source instance to import from",
"ImportListsSonarrSettingsRootFoldersHelpText": "Root Folders from the source instance to import from",
"ImportListsSonarrSettingsTagsHelpText": "Tags from the source instance to import from",
"ImportListsSonarrValidationInvalidUrl": "{appName} URL is invalid, are you missing a URL base?",
"ImportListsTraktSettingsAdditionalParameters": "Additional Parameters",
"ImportListsTraktSettingsAdditionalParametersHelpText": "Additional Trakt API parameters",
"ImportListsTraktSettingsAuthenticateWithTrakt": "Authenticate with Trakt",
"ImportListsTraktSettingsGenres": "Genres",
"ImportListsTraktSettingsGenresHelpText": "Filter series by Trakt Genre Slug (Comma Separated) Only for Popular Lists",
"ImportListsTraktSettingsLimit": "Limit",
"ImportListsTraktSettingsLimitHelpText": "Limit the number of series to get",
"ImportListsTraktSettingsListName": "List Name",
"ImportListsTraktSettingsListNameHelpText": "List name for import, list must be public or you must have access to the list",
"ImportListsTraktSettingsListType": "List Type",
"ImportListsTraktSettingsListTypeHelpText": "Type of list you're seeking to import from",
"ImportListsTraktSettingsPopularListTypeAnticipatedShows": "Anticipated Shows",
"ImportListsTraktSettingsPopularListTypePopularShows": "Popular Shows",
"ImportListsTraktSettingsPopularListTypeRecommendedAllTimeShows": "Recommended Shows Of All Time",
"ImportListsTraktSettingsPopularListTypeRecommendedMonthShows": "Recommended Shows By Month",
"ImportListsTraktSettingsPopularListTypeRecommendedWeekShows": "Recommended Shows By Week",
"ImportListsTraktSettingsPopularListTypeRecommendedYearShows": "Recommended Shows By Year",
"ImportListsTraktSettingsPopularListTypeTopAllTimeShows": "Top Watched Shows Of All Time",
"ImportListsTraktSettingsPopularListTypeTopMonthShows": "Top Watched Shows By Month",
"ImportListsTraktSettingsPopularListTypeTopWeekShows": "Top Watched Shows By Week",
"ImportListsTraktSettingsPopularListTypeTopYearShows": "Top Watched Shows By Year",
"ImportListsTraktSettingsPopularListTypeTrendingShows": "Trending Shows",
"ImportListsTraktSettingsPopularName": "Trakt Popular List",
"ImportListsTraktSettingsRating": "Rating",
"ImportListsTraktSettingsRatingHelpText": "Filter series by rating range (0-100)",
"ImportListsTraktSettingsUserListName": "Trakt User",
"ImportListsTraktSettingsUserListTypeCollection": "User Collection List",
"ImportListsTraktSettingsUserListTypeWatch": "User Watch List",
"ImportListsTraktSettingsUserListTypeWatched": "User Watched List",
"ImportListsTraktSettingsUserListUsernameHelpText": "Username for the List to import from (leave empty to use Auth User)",
"ImportListsTraktSettingsUsernameHelpText": "Username for the List to import from",
"ImportListsTraktSettingsWatchedListFilter": "Watched List Filter",
"ImportListsTraktSettingsWatchedListFilterHelpText": "If List Type is Watched, select the series type you want to import",
"ImportListsTraktSettingsWatchedListSorting": "Watch List Sorting",
"ImportListsTraktSettingsWatchedListSortingHelpText": "If List Type is Watched, select the order to sort the list",
"ImportListsTraktSettingsWatchedListTypeAll": "All",
"ImportListsTraktSettingsWatchedListTypeCompleted": "100% Watched",
"ImportListsTraktSettingsWatchedListTypeInProgress": "In Progress",
"ImportListsTraktSettingsYears": "Years",
"ImportListsTraktSettingsYearsHelpText": "Filter series by year or year range",
"ImportListsValidationInvalidApiKey": "API Key is invalid",
"ImportListsValidationTestFailed": "Test was aborted due to an error: {exceptionMessage}",
"ImportListsValidationUnableToConnectException": "Unable to connect to import list: {exceptionMessage}. Check the log surrounding this error for details.",
"ImportMechanismEnableCompletedDownloadHandlingIfPossibleHealthCheckMessage": "Enable Completed Download Handling if possible",
"ImportMechanismEnableCompletedDownloadHandlingIfPossibleMultiComputerHealthCheckMessage": "Enable Completed Download Handling if possible (Multi-Computer unsupported)",
"ImportMechanismHandlingDisabledHealthCheckMessage": "Enable Completed Download Handling",
@ -959,12 +1077,26 @@
"Message": "Message",
"Metadata": "Metadata",
"MetadataLoadError": "Unable to load Metadata",
"MetadataPlexSettingsSeriesPlexMatchFile": "Series Plex Match File",
"MetadataPlexSettingsSeriesPlexMatchFileHelpText": "Creates a .plexmatch file in the series folder",
"MetadataProvidedBy": "Metadata is provided by {provider}",
"MetadataSettings": "Metadata Settings",
"MetadataSettingsEpisodeImages": "Episode Images",
"MetadataSettingsEpisodeMetadata": "Episode Metadata",
"MetadataSettingsEpisodeMetadataImageThumbs": "Episode Metadata Image Thumbs",
"MetadataSettingsSeasonImages": "Season Images",
"MetadataSettingsSeriesImages": "Series Images",
"MetadataSettingsSeriesMetadata": "Series Metadata",
"MetadataSettingsSeriesMetadataEpisodeGuide": "Series Metadata Episode Guide",
"MetadataSettingsSeriesMetadataUrl": "Series Metadata URL",
"MetadataSettingsSeriesSummary": "Create metadata files when episodes are imported or series are refreshed",
"MetadataSource": "Metadata Source",
"MetadataSourceSettings": "Metadata Source Settings",
"MetadataSourceSettingsSeriesSummary": "Information on where {appName} gets series and episode information",
"MetadataXmbcSettingsEpisodeMetadataImageThumbsHelpText": "Include image thumb tags in <filename>.nfo (Requires 'Episode Metadata')",
"MetadataXmbcSettingsSeriesMetadataEpisodeGuideHelpText": "Include JSON formatted episode guide element in tvshow.nfo (Requires 'Series Metadata')",
"MetadataXmbcSettingsSeriesMetadataHelpText": "tvshow.nfo with full series metadata",
"MetadataXmbcSettingsSeriesMetadataUrlHelpText": "Include TheTVDB show URL in tvshow.nfo (can be combined with 'Series Metadata')",
"MidseasonFinale": "Midseason Finale",
"Min": "Min",
"MinimumAge": "Minimum Age",

@ -228,10 +228,15 @@ namespace Sonarr.Http.ClientSchema
if (attrib != null)
{
var label = attrib.Label.IsNotNullOrWhiteSpace()
? _localizationService.GetLocalizedString(attrib.Label,
GetTokens(selectOptions, attrib.Label, TokenField.Label))
: attrib.Label;
return new SelectOption
{
Value = value,
Name = attrib.Label ?? name,
Name = label ?? name,
Order = attrib.Order,
Hint = attrib.Hint ?? $"({value})"
};

Loading…
Cancel
Save