From beca2c99ca283f43eaf34091a8f3966ba584307f Mon Sep 17 00:00:00 2001 From: junk_receiver Date: Fri, 10 Sep 2021 19:44:44 -0700 Subject: [PATCH] Add per-file rename information for Discord and Slack --- .../Notifications/Discord/Discord.cs | 17 ++++++++++------- src/NzbDrone.Core/Notifications/Slack/Slack.cs | 17 ++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Discord/Discord.cs b/src/NzbDrone.Core/Notifications/Discord/Discord.cs index 9f6b69a899..083d07c545 100644 --- a/src/NzbDrone.Core/Notifications/Discord/Discord.cs +++ b/src/NzbDrone.Core/Notifications/Discord/Discord.cs @@ -216,13 +216,16 @@ public override void OnDownload(DownloadMessage message) public override void OnMovieRename(Movie movie, List renamedFiles) { - var attachments = new List - { - new Embed - { - Title = movie.Title, - } - }; + var attachments = new List(); + + foreach (RenamedMovieFile renamedFile in renamedFiles) + { + attachments.Add(new Embed + { + Title = movie.Title, + Description = renamedFile.PreviousRelativePath + " renamed to " + renamedFile.MovieFile.RelativePath, + }); + } var payload = CreatePayload("Renamed", attachments); diff --git a/src/NzbDrone.Core/Notifications/Slack/Slack.cs b/src/NzbDrone.Core/Notifications/Slack/Slack.cs index ed79e8e451..a9a2d33498 100644 --- a/src/NzbDrone.Core/Notifications/Slack/Slack.cs +++ b/src/NzbDrone.Core/Notifications/Slack/Slack.cs @@ -59,13 +59,16 @@ public override void OnDownload(DownloadMessage message) public override void OnMovieRename(Movie movie, List renamedFiles) { - var attachments = new List - { - new Attachment - { - Title = movie.Title, - } - }; + var attachments = new List(); + + foreach (RenamedMovieFile renamedFile in renamedFiles) + { + attachments.Add(new Attachment + { + Title = movie.Title, + Text = renamedFile.PreviousRelativePath + " renamed to " + renamedFile.MovieFile.RelativePath, + }); + } var payload = CreatePayload("Renamed", attachments);