diff --git a/frontend/src/Settings/Notifications/Notifications/Notification.js b/frontend/src/Settings/Notifications/Notifications/Notification.js
index 9fb6a1ef0..9030cc198 100644
--- a/frontend/src/Settings/Notifications/Notifications/Notification.js
+++ b/frontend/src/Settings/Notifications/Notifications/Notification.js
@@ -66,6 +66,7 @@ class Notification extends Component {
onHealthIssue,
onHealthRestored,
onApplicationUpdate,
+ onManualInteractionRequired,
supportsOnGrab,
supportsOnDownload,
supportsOnUpgrade,
@@ -76,7 +77,8 @@ class Notification extends Component {
supportsOnMovieFileDeleteForUpgrade,
supportsOnHealthIssue,
supportsOnHealthRestored,
- supportsOnApplicationUpdate
+ supportsOnApplicationUpdate,
+ supportsOnManualInteractionRequired
} = this.props;
return (
@@ -178,7 +180,15 @@ class Notification extends Component {
}
{
- !onGrab && !onDownload && !onRename && !onHealthIssue && !onHealthRestored && !onApplicationUpdate && !onMovieDelete && !onMovieFileDelete ?
+ supportsOnManualInteractionRequired && onManualInteractionRequired ?
+ :
+ null
+ }
+
+ {
+ !onGrab && !onDownload && !onRename && !onHealthIssue && !onHealthRestored && !onApplicationUpdate && !onMovieDelete && !onMovieFileDelete && !onManualInteractionRequired ?
+
+
+
+
diff --git a/frontend/src/Store/Actions/Settings/notifications.js b/frontend/src/Store/Actions/Settings/notifications.js
index f69fcf393..1125b55fe 100644
--- a/frontend/src/Store/Actions/Settings/notifications.js
+++ b/frontend/src/Store/Actions/Settings/notifications.js
@@ -111,6 +111,7 @@ export default {
selectedSchema.onMovieFileDelete = selectedSchema.supportsOnMovieFileDelete;
selectedSchema.onMovieFileDeleteForUpgrade = selectedSchema.supportsOnMovieFileDeleteForUpgrade;
selectedSchema.onApplicationUpdate = selectedSchema.supportsOnApplicationUpdate;
+ selectedSchema.onManualInteractionRequired = selectedSchema.supportsOnManualInteractionRequired;
return selectedSchema;
});
diff --git a/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceTests/ProcessFixture.cs b/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceTests/ProcessFixture.cs
index a7aa1dcbf..1438aadc1 100644
--- a/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceTests/ProcessFixture.cs
+++ b/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceTests/ProcessFixture.cs
@@ -52,8 +52,8 @@ namespace NzbDrone.Core.Test.Download.CompletedDownloadServiceTests
.Returns((DownloadClientItem item, DownloadClientItem previous) => item);
Mocker.GetMock()
- .Setup(s => s.MostRecentForDownloadId(_trackedDownload.DownloadItem.DownloadId))
- .Returns(new MovieHistory());
+ .Setup(s => s.FindByDownloadId(_trackedDownload.DownloadItem.DownloadId))
+ .Returns(new List());
Mocker.GetMock()
.Setup(s => s.GetMovie("Drone.S01E01.HDTV"))
@@ -71,8 +71,8 @@ namespace NzbDrone.Core.Test.Download.CompletedDownloadServiceTests
private void GivenNoGrabbedHistory()
{
Mocker.GetMock()
- .Setup(s => s.MostRecentForDownloadId(_trackedDownload.DownloadItem.DownloadId))
- .Returns((MovieHistory)null);
+ .Setup(s => s.FindByDownloadId(_trackedDownload.DownloadItem.DownloadId))
+ .Returns(new List());
}
private void GivenMovieMatch()
@@ -87,8 +87,11 @@ namespace NzbDrone.Core.Test.Download.CompletedDownloadServiceTests
_trackedDownload.DownloadItem.DownloadId = "1234";
_trackedDownload.DownloadItem.Title = "Droned Pilot"; // Set a badly named download
Mocker.GetMock()
- .Setup(s => s.MostRecentForDownloadId(It.Is(i => i == "1234")))
- .Returns(new MovieHistory() { SourceTitle = "Droned S01E01" });
+ .Setup(s => s.FindByDownloadId(It.Is(i => i == "1234")))
+ .Returns(new List
+ {
+ new MovieHistory() { SourceTitle = "Droned S01E01", EventType = MovieHistoryEventType.Grabbed }
+ });
Mocker.GetMock()
.Setup(s => s.GetMovie(It.IsAny()))
@@ -158,9 +161,6 @@ namespace NzbDrone.Core.Test.Download.CompletedDownloadServiceTests
new ImportResult(new ImportDecision(new LocalMovie { Path = @"C:\TestPath\Droned.S01E01.mkv" }))
});
- Mocker.GetMock()
- .Setup(s => s.MostRecentForDownloadId(It.Is(i => i == "1234")));
-
Subject.Check(_trackedDownload);
AssertNotReadyToImport();
diff --git a/src/NzbDrone.Core.Test/MediaFiles/MovieImport/Specifications/MatchesGrabSpecificationFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/MovieImport/Specifications/MatchesGrabSpecificationFixture.cs
index 5821dad59..a09e932d6 100644
--- a/src/NzbDrone.Core.Test/MediaFiles/MovieImport/Specifications/MatchesGrabSpecificationFixture.cs
+++ b/src/NzbDrone.Core.Test/MediaFiles/MovieImport/Specifications/MatchesGrabSpecificationFixture.cs
@@ -2,7 +2,9 @@ using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
+using NzbDrone.Common.Extensions;
using NzbDrone.Core.Download;
+using NzbDrone.Core.History;
using NzbDrone.Core.MediaFiles.MovieImport.Specifications;
using NzbDrone.Core.Movies;
using NzbDrone.Core.Parser.Model;
@@ -46,8 +48,22 @@ namespace NzbDrone.Core.Test.MediaFiles.MovieImport.Specifications
private void GivenHistoryForMovies(params Movie[] movies)
{
- _localMovie.Release = new GrabbedReleaseInfo();
- _localMovie.Release.MovieIds = movies.Select(e => e.Id).ToList();
+ if (movies.Empty())
+ {
+ return;
+ }
+
+ var grabbedHistories = Builder.CreateListOfSize(movies.Length)
+ .All()
+ .With(h => h.EventType == MovieHistoryEventType.Grabbed)
+ .BuildList();
+
+ for (var i = 0; i < grabbedHistories.Count; i++)
+ {
+ grabbedHistories[i].MovieId = movies[i].Id;
+ }
+
+ _localMovie.Release = new GrabbedReleaseInfo(grabbedHistories);
}
[Test]
diff --git a/src/NzbDrone.Core.Test/NotificationTests/NotificationBaseFixture.cs b/src/NzbDrone.Core.Test/NotificationTests/NotificationBaseFixture.cs
index 37c6e63d3..3aa4ab2fc 100644
--- a/src/NzbDrone.Core.Test/NotificationTests/NotificationBaseFixture.cs
+++ b/src/NzbDrone.Core.Test/NotificationTests/NotificationBaseFixture.cs
@@ -93,6 +93,11 @@ namespace NzbDrone.Core.Test.NotificationTests
{
TestLogger.Info("OnApplicationUpdate was called");
}
+
+ public override void OnManualInteractionRequired(ManualInteractionRequiredMessage message)
+ {
+ TestLogger.Info("OnManualInteractionRequired was called");
+ }
}
private class TestNotificationWithNoEvents : NotificationBase
@@ -134,6 +139,7 @@ namespace NzbDrone.Core.Test.NotificationTests
notification.SupportsOnHealthIssue.Should().BeTrue();
notification.SupportsOnHealthRestored.Should().BeTrue();
notification.SupportsOnApplicationUpdate.Should().BeTrue();
+ notification.SupportsOnManualInteractionRequired.Should().BeTrue();
}
[Test]
@@ -152,6 +158,7 @@ namespace NzbDrone.Core.Test.NotificationTests
notification.SupportsOnHealthIssue.Should().BeFalse();
notification.SupportsOnHealthRestored.Should().BeFalse();
notification.SupportsOnApplicationUpdate.Should().BeFalse();
+ notification.SupportsOnManualInteractionRequired.Should().BeFalse();
}
}
}
diff --git a/src/NzbDrone.Core/Datastore/Migration/221_add_on_manual_interaction_required_to_notifications.cs b/src/NzbDrone.Core/Datastore/Migration/221_add_on_manual_interaction_required_to_notifications.cs
new file mode 100644
index 000000000..43d99b2f6
--- /dev/null
+++ b/src/NzbDrone.Core/Datastore/Migration/221_add_on_manual_interaction_required_to_notifications.cs
@@ -0,0 +1,14 @@
+using FluentMigrator;
+using NzbDrone.Core.Datastore.Migration.Framework;
+
+namespace NzbDrone.Core.Datastore.Migration
+{
+ [Migration(221)]
+ public class add_on_manual_interaction_required_to_notifications : NzbDroneMigrationBase
+ {
+ protected override void MainDbUpgrade()
+ {
+ Alter.Table("Notifications").AddColumn("OnManualInteractionRequired").AsBoolean().WithDefaultValue(false);
+ }
+ }
+}
diff --git a/src/NzbDrone.Core/Datastore/TableMapping.cs b/src/NzbDrone.Core/Datastore/TableMapping.cs
index 5f7f1bf1e..9b2d8236c 100644
--- a/src/NzbDrone.Core/Datastore/TableMapping.cs
+++ b/src/NzbDrone.Core/Datastore/TableMapping.cs
@@ -94,7 +94,8 @@ namespace NzbDrone.Core.Datastore
.Ignore(i => i.SupportsOnMovieFileDeleteForUpgrade)
.Ignore(i => i.SupportsOnHealthIssue)
.Ignore(i => i.SupportsOnHealthRestored)
- .Ignore(i => i.SupportsOnApplicationUpdate);
+ .Ignore(i => i.SupportsOnApplicationUpdate)
+ .Ignore(i => i.SupportsOnManualInteractionRequired);
Mapper.Entity("Metadata").RegisterModel()
.Ignore(x => x.ImplementationName)
diff --git a/src/NzbDrone.Core/Download/CompletedDownloadService.cs b/src/NzbDrone.Core/Download/CompletedDownloadService.cs
index 838e18c97..267e3f15f 100644
--- a/src/NzbDrone.Core/Download/CompletedDownloadService.cs
+++ b/src/NzbDrone.Core/Download/CompletedDownloadService.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using NLog;
-using NLog.Fluent;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation.Extensions;
@@ -70,7 +69,8 @@ namespace NzbDrone.Core.Download
return;
}
- var historyItem = _historyService.MostRecentForDownloadId(trackedDownload.DownloadItem.DownloadId);
+ var grabbedHistories = _historyService.FindByDownloadId(trackedDownload.DownloadItem.DownloadId).Where(h => h.EventType == MovieHistoryEventType.Grabbed).ToList();
+ var historyItem = grabbedHistories.MaxBy(h => h.Date);
if (historyItem == null && trackedDownload.DownloadItem.Category.IsNullOrWhiteSpace())
{
@@ -105,6 +105,17 @@ namespace NzbDrone.Core.Download
if (movieMatchType == MovieMatchType.Id && releaseSource != ReleaseSourceType.InteractiveSearch)
{
trackedDownload.Warn("Found matching movie via grab history, but release was matched to movie by ID. Manual Import required.");
+
+ if (!trackedDownload.HasNotifiedManualInteractionRequired)
+ {
+ trackedDownload.HasNotifiedManualInteractionRequired = true;
+
+ var releaseInfo = new GrabbedReleaseInfo(grabbedHistories);
+ var manualInteractionEvent = new ManualInteractionRequiredEvent(trackedDownload, releaseInfo);
+
+ _eventAggregator.PublishEvent(manualInteractionEvent);
+ }
+
return;
}
}
diff --git a/src/NzbDrone.Core/Download/ManualInteractionRequiredEvent.cs b/src/NzbDrone.Core/Download/ManualInteractionRequiredEvent.cs
new file mode 100644
index 000000000..06f0c2916
--- /dev/null
+++ b/src/NzbDrone.Core/Download/ManualInteractionRequiredEvent.cs
@@ -0,0 +1,20 @@
+using NzbDrone.Common.Messaging;
+using NzbDrone.Core.Download.TrackedDownloads;
+using NzbDrone.Core.Parser.Model;
+
+namespace NzbDrone.Core.Download
+{
+ public class ManualInteractionRequiredEvent : IEvent
+ {
+ public RemoteMovie RemoteMovie { get; private set; }
+ public TrackedDownload TrackedDownload { get; private set; }
+ public GrabbedReleaseInfo Release { get; private set; }
+
+ public ManualInteractionRequiredEvent(TrackedDownload trackedDownload, GrabbedReleaseInfo release)
+ {
+ TrackedDownload = trackedDownload;
+ RemoteMovie = trackedDownload.RemoteMovie;
+ Release = release;
+ }
+ }
+}
diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs
index 2794e6da2..1f7ef3a36 100644
--- a/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs
+++ b/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs
@@ -15,6 +15,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
IExecute,
IHandle,
IHandle,
+ IHandle,
IHandle,
IHandle
{
@@ -169,6 +170,11 @@ namespace NzbDrone.Core.Download.TrackedDownloads
_refreshDebounce.Execute();
}
+ public void Handle(ManualInteractionRequiredEvent message)
+ {
+ _refreshDebounce.Execute();
+ }
+
public void Handle(MovieFileImportedEvent message)
{
_refreshDebounce.Execute();
diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownload.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownload.cs
index f0623dc84..df6ea4280 100644
--- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownload.cs
+++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownload.cs
@@ -1,3 +1,4 @@
+using System;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Parser.Model;
@@ -15,10 +16,11 @@ namespace NzbDrone.Core.Download.TrackedDownloads
public DownloadProtocol Protocol { get; set; }
public string Indexer { get; set; }
public bool IsTrackable { get; set; }
+ public bool HasNotifiedManualInteractionRequired { get; set; }
public TrackedDownload()
{
- StatusMessages = System.Array.Empty();
+ StatusMessages = Array.Empty();
}
public void Warn(string message, params object[] args)
diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs
index 4f911aa21..e3e0afcd8 100644
--- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs
+++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs
@@ -107,7 +107,8 @@ namespace NzbDrone.Core.Download.TrackedDownloads
DownloadClient = downloadClient.Id,
DownloadItem = downloadItem,
Protocol = downloadClient.Protocol,
- IsTrackable = true
+ IsTrackable = true,
+ HasNotifiedManualInteractionRequired = existingItem?.HasNotifiedManualInteractionRequired ?? false
};
try
diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json
index fac71538e..23537273d 100644
--- a/src/NzbDrone.Core/Localization/Core/en.json
+++ b/src/NzbDrone.Core/Localization/Core/en.json
@@ -53,6 +53,8 @@
"ApplicationURL": "Application URL",
"ApplicationUrlHelpText": "This application's external URL including http(s)://, port and URL base",
"Apply": "Apply",
+ "OnManualInteractionRequired": "On Manual Interaction Required",
+ "OnManualInteractionRequiredHelpText": "On Manual Interaction Required",
"ApplyTags": "Apply Tags",
"ApplyTagsHelpTexts1": "How to apply tags to the selected movies",
"ApplyTagsHelpTexts2": "Add: Add the tags to the existing list of tags",
diff --git a/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateReleaseInfo.cs b/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateReleaseInfo.cs
index 1b6dc92cf..50d2f8522 100644
--- a/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateReleaseInfo.cs
+++ b/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateReleaseInfo.cs
@@ -31,20 +31,7 @@ namespace NzbDrone.Core.MediaFiles.MovieImport.Aggregation.Aggregators
return localMovie;
}
- var movieIds = grabbedHistories.Select(h => h.MovieId).Distinct().ToList();
- var grabbedHistory = grabbedHistories.First();
- var releaseInfo = new GrabbedReleaseInfo();
-
- grabbedHistory.Data.TryGetValue("indexer", out var indexer);
- grabbedHistory.Data.TryGetValue("size", out var sizeString);
- long.TryParse(sizeString, out var size);
-
- releaseInfo.Title = grabbedHistory.SourceTitle;
- releaseInfo.Indexer = indexer;
- releaseInfo.Size = size;
- releaseInfo.MovieIds = movieIds;
-
- localMovie.Release = releaseInfo;
+ localMovie.Release = new GrabbedReleaseInfo(grabbedHistories);
return localMovie;
}
diff --git a/src/NzbDrone.Core/Notifications/Apprise/Apprise.cs b/src/NzbDrone.Core/Notifications/Apprise/Apprise.cs
index 49379bd5d..ab48e77b6 100644
--- a/src/NzbDrone.Core/Notifications/Apprise/Apprise.cs
+++ b/src/NzbDrone.Core/Notifications/Apprise/Apprise.cs
@@ -58,6 +58,11 @@ namespace NzbDrone.Core.Notifications.Apprise
_proxy.SendNotification(APPLICATION_UPDATE_TITLE, updateMessage.Message, Settings);
}
+ public override void OnManualInteractionRequired(ManualInteractionRequiredMessage message)
+ {
+ _proxy.SendNotification(MANUAL_INTERACTION_REQUIRED_TITLE, message.Message, Settings);
+ }
+
public override ValidationResult Test()
{
var failures = new List();
diff --git a/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs b/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs
index 2f40df644..b7f7cfa5f 100644
--- a/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs
+++ b/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs
@@ -57,6 +57,11 @@ namespace NzbDrone.Core.Notifications.Boxcar
_proxy.SendNotification(APPLICATION_UPDATE_TITLE, message.Message, Settings);
}
+ public override void OnManualInteractionRequired(ManualInteractionRequiredMessage message)
+ {
+ _proxy.SendNotification(MANUAL_INTERACTION_REQUIRED_TITLE, message.Message, Settings);
+ }
+
public override ValidationResult Test()
{
var failures = new List();
diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs
index 1eef23100..7f4e31e1e 100755
--- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs
+++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs
@@ -277,6 +277,30 @@ namespace NzbDrone.Core.Notifications.CustomScript
ExecuteScript(environmentVariables);
}
+ public override void OnManualInteractionRequired(ManualInteractionRequiredMessage message)
+ {
+ var movie = message.Movie;
+ var environmentVariables = new StringDictionary();
+
+ environmentVariables.Add("Radarr_EventType", "ManualInteractionRequired");
+ environmentVariables.Add("Radarr_InstanceName", _configFileProvider.InstanceName);
+ environmentVariables.Add("Radarr_ApplicationUrl", _configService.ApplicationUrl);
+ environmentVariables.Add("Radarr_Movie_Id", movie.Id.ToString());
+ environmentVariables.Add("Radarr_Movie_Title", movie.MovieMetadata.Value.Title);
+ environmentVariables.Add("Radarr_Movie_Year", movie.MovieMetadata.Value.Year.ToString());
+ environmentVariables.Add("Radarr_Movie_Path", movie.Path);
+ environmentVariables.Add("Radarr_Movie_ImdbId", movie.MovieMetadata.Value.ImdbId ?? string.Empty);
+ environmentVariables.Add("Radarr_Movie_TmdbId", movie.MovieMetadata.Value.TmdbId.ToString());
+ environmentVariables.Add("Radarr_Movie_Overview", movie.MovieMetadata.Value.Overview);
+ environmentVariables.Add("Radarr_Download_Client", message.DownloadClientName ?? string.Empty);
+ environmentVariables.Add("Radarr_Download_Client_Type", message.DownloadClientType ?? string.Empty);
+ environmentVariables.Add("Radarr_Download_Id", message.DownloadId ?? string.Empty);
+ environmentVariables.Add("Radarr_Download_Size", message.TrackedDownload.DownloadItem.TotalSize.ToString());
+ environmentVariables.Add("Radarr_Download_Title", message.TrackedDownload.DownloadItem.Title);
+
+ ExecuteScript(environmentVariables);
+ }
+
public override ValidationResult Test()
{
var failures = new List();
diff --git a/src/NzbDrone.Core/Notifications/Discord/Discord.cs b/src/NzbDrone.Core/Notifications/Discord/Discord.cs
index 81457dc5f..f5c83dcaf 100644
--- a/src/NzbDrone.Core/Notifications/Discord/Discord.cs
+++ b/src/NzbDrone.Core/Notifications/Discord/Discord.cs
@@ -379,6 +379,95 @@ namespace NzbDrone.Core.Notifications.Discord
_proxy.SendPayload(payload, Settings);
}
+ public override void OnManualInteractionRequired(ManualInteractionRequiredMessage message)
+ {
+ var movie = message.Movie;
+
+ var embed = new Embed
+ {
+ Author = new DiscordAuthor
+ {
+ Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
+ IconUrl = "https://raw.githubusercontent.com/Radarr/Radarr/develop/Logo/256.png"
+ },
+ Url = $"https://www.themoviedb.org/movie/{movie.MovieMetadata.Value.TmdbId}",
+ Description = "Manual interaction needed",
+ Title = movie.MovieMetadata.Value.Title,
+ Color = (int)DiscordColors.Standard,
+ Fields = new List(),
+ Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ")
+ };
+
+ if (Settings.ManualInteractionFields.Contains((int)DiscordGrabFieldType.Poster))
+ {
+ embed.Thumbnail = new DiscordImage
+ {
+ Url = movie.MovieMetadata.Value.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Poster)?.Url
+ };
+ }
+
+ if (Settings.ManualInteractionFields.Contains((int)DiscordGrabFieldType.Fanart))
+ {
+ embed.Image = new DiscordImage
+ {
+ Url = movie.MovieMetadata.Value.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Fanart)?.Url
+ };
+ }
+
+ foreach (var field in Settings.ManualInteractionFields)
+ {
+ var discordField = new DiscordField();
+
+ switch ((DiscordManualInteractionFieldType)field)
+ {
+ case DiscordManualInteractionFieldType.Overview:
+ var overview = movie.MovieMetadata.Value.Overview ?? "";
+ discordField.Name = "Overview";
+ discordField.Value = overview.Length <= 300 ? overview : $"{overview.AsSpan(0, 300)}...";
+ break;
+ case DiscordManualInteractionFieldType.Rating:
+ discordField.Name = "Rating";
+ discordField.Value = movie.MovieMetadata.Value.Ratings.Tmdb?.Value.ToString() ?? string.Empty;
+ break;
+ case DiscordManualInteractionFieldType.Genres:
+ discordField.Name = "Genres";
+ discordField.Value = movie.MovieMetadata.Value.Genres.Take(5).Join(", ");
+ break;
+ case DiscordManualInteractionFieldType.Quality:
+ discordField.Name = "Quality";
+ discordField.Inline = true;
+ discordField.Value = message.Quality.Quality.Name;
+ break;
+ case DiscordManualInteractionFieldType.Group:
+ discordField.Name = "Group";
+ discordField.Value = message.RemoteMovie.ParsedMovieInfo.ReleaseGroup;
+ break;
+ case DiscordManualInteractionFieldType.Size:
+ discordField.Name = "Size";
+ discordField.Value = BytesToString(message.TrackedDownload.DownloadItem.TotalSize);
+ discordField.Inline = true;
+ break;
+ case DiscordManualInteractionFieldType.DownloadTitle:
+ discordField.Name = "Download";
+ discordField.Value = string.Format("```{0}```", message.TrackedDownload.DownloadItem.Title);
+ break;
+ case DiscordManualInteractionFieldType.Links:
+ discordField.Name = "Links";
+ discordField.Value = GetLinksString(message.Movie);
+ break;
+ }
+
+ if (discordField.Name.IsNotNullOrWhiteSpace() && discordField.Value.IsNotNullOrWhiteSpace())
+ {
+ embed.Fields.Add(discordField);
+ }
+ }
+
+ var payload = CreatePayload(null, new List