1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04:00

New: Support Plex API Path Scan (Similar to autoscan)

Closes #4640
Closes #5527
This commit is contained in:
Qstick
2022-04-21 22:49:09 -05:00
parent 2fc7cbff89
commit 24206ad0a3
3 changed files with 109 additions and 12 deletions
@@ -1,4 +1,5 @@
using FluentValidation;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
@@ -11,6 +12,8 @@ namespace NzbDrone.Core.Notifications.Plex.Server
{
RuleFor(c => c.Host).ValidHost();
RuleFor(c => c.Port).InclusiveBetween(1, 65535);
RuleFor(c => c.MapFrom).NotEmpty().Unless(c => c.MapTo.IsNullOrWhiteSpace());
RuleFor(c => c.MapTo).NotEmpty().Unless(c => c.MapFrom.IsNullOrWhiteSpace());
}
}
@@ -43,6 +46,12 @@ namespace NzbDrone.Core.Notifications.Plex.Server
[FieldDefinition(5, Label = "Update Library", Type = FieldType.Checkbox)]
public bool UpdateLibrary { get; set; }
[FieldDefinition(6, Label = "Map Paths From", Type = FieldType.Textbox, Advanced = true, HelpText = "Radarr Path, Used to modify movie paths when Plex sees library path location differently from Radarr")]
public string MapFrom { get; set; }
[FieldDefinition(7, Label = "Map Paths To", Type = FieldType.Textbox, Advanced = true, HelpText = "Plex Path, Used to modify movie paths when Plex sees library path location differently from Radarr")]
public string MapTo { get; set; }
public bool IsValid => !string.IsNullOrWhiteSpace(Host);
public NzbDroneValidationResult Validate()