mirror of
https://github.com/Readarr/Readarr
synced 2026-02-04 05:42:29 +01:00
Fixed: Audiobooks will not be attached to email notifications
This commit is contained in:
parent
c5281d04f1
commit
e8ddaf6ccf
1 changed files with 11 additions and 3 deletions
|
|
@ -7,6 +7,7 @@
|
|||
using MimeKit;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
|
||||
namespace NzbDrone.Core.Notifications.Email
|
||||
{
|
||||
|
|
@ -101,9 +102,16 @@ private void SendEmail(EmailSettings settings, string subject, string body, bool
|
|||
builder.HtmlBody = body;
|
||||
foreach (var url in attachmentUrls)
|
||||
{
|
||||
byte[] bytes = System.IO.File.ReadAllBytes(url);
|
||||
builder.Attachments.Add(url, bytes);
|
||||
_logger.Trace("Attaching: {0}", url);
|
||||
if (MediaFileExtensions.AudioExtensions.Contains(System.IO.Path.GetExtension(url)))
|
||||
{
|
||||
byte[] bytes = System.IO.File.ReadAllBytes(url);
|
||||
builder.Attachments.Add(url, bytes);
|
||||
_logger.Trace("Attaching ebook file: {0}", url);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Trace("Skipping audiobook file: {0}", url);
|
||||
}
|
||||
}
|
||||
|
||||
email.Body = builder.ToMessageBody();
|
||||
|
|
|
|||
Loading…
Reference in a new issue