diff --git a/frontend/src/Settings/Metadata/MetadataProvider/MetadataProvider.js b/frontend/src/Settings/Metadata/MetadataProvider/MetadataProvider.js
index e0bbe3ec6..10448892c 100644
--- a/frontend/src/Settings/Metadata/MetadataProvider/MetadataProvider.js
+++ b/frontend/src/Settings/Metadata/MetadataProvider/MetadataProvider.js
@@ -61,6 +61,23 @@ function MetadataProvider(props) {
/>
+ {
+ settings.writeAudioTags.value !== 'no' &&
+
+
+ {translate('EmbedCoverArtInAudioFiles')}
+
+
+
+
+ }
+
{translate('ScrubExistingTags')}
diff --git a/src/Lidarr.Api.V1/Config/MetadataProviderConfigResource.cs b/src/Lidarr.Api.V1/Config/MetadataProviderConfigResource.cs
index 8d29a2356..af2c930fd 100644
--- a/src/Lidarr.Api.V1/Config/MetadataProviderConfigResource.cs
+++ b/src/Lidarr.Api.V1/Config/MetadataProviderConfigResource.cs
@@ -8,6 +8,7 @@ namespace Lidarr.Api.V1.Config
public string MetadataSource { get; set; }
public WriteAudioTagsType WriteAudioTags { get; set; }
public bool ScrubAudioTags { get; set; }
+ public bool EmbedCoverArt { get; set; }
}
public static class MetadataProviderConfigResourceMapper
@@ -19,6 +20,7 @@ namespace Lidarr.Api.V1.Config
MetadataSource = model.MetadataSource,
WriteAudioTags = model.WriteAudioTags,
ScrubAudioTags = model.ScrubAudioTags,
+ EmbedCoverArt = model.EmbedCoverArt,
};
}
}
diff --git a/src/NzbDrone.Core.Test/MediaFiles/AudioTagServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/AudioTagServiceFixture.cs
index cfc6259c4..6a0520803 100644
--- a/src/NzbDrone.Core.Test/MediaFiles/AudioTagServiceFixture.cs
+++ b/src/NzbDrone.Core.Test/MediaFiles/AudioTagServiceFixture.cs
@@ -65,6 +65,10 @@ namespace NzbDrone.Core.Test.MediaFiles.AudioTagServiceFixture
.Setup(x => x.WriteAudioTags)
.Returns(WriteAudioTagsType.Sync);
+ Mocker.GetMock()
+ .Setup(x => x.EmbedCoverArt)
+ .Returns(true);
+
var imageFile = Path.Combine(_testdir, "nin.png");
var imageSize = _diskProvider.GetFileSize(imageFile);
diff --git a/src/NzbDrone.Core/Configuration/ConfigService.cs b/src/NzbDrone.Core/Configuration/ConfigService.cs
index 84a2bfe6d..6aa7c5448 100644
--- a/src/NzbDrone.Core/Configuration/ConfigService.cs
+++ b/src/NzbDrone.Core/Configuration/ConfigService.cs
@@ -283,6 +283,13 @@ namespace NzbDrone.Core.Configuration
set { SetValue("ScrubAudioTags", value); }
}
+ public bool EmbedCoverArt
+ {
+ get { return GetValueBoolean("EmbedCoverArt", true); }
+
+ set { SetValue("EmbedCoverArt", value); }
+ }
+
public int FirstDayOfWeek
{
get { return GetValueInt("FirstDayOfWeek", (int)CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek); }
diff --git a/src/NzbDrone.Core/Configuration/IConfigService.cs b/src/NzbDrone.Core/Configuration/IConfigService.cs
index 4009ffb6d..1665334d4 100644
--- a/src/NzbDrone.Core/Configuration/IConfigService.cs
+++ b/src/NzbDrone.Core/Configuration/IConfigService.cs
@@ -76,6 +76,7 @@ namespace NzbDrone.Core.Configuration
string MetadataSource { get; set; }
WriteAudioTagsType WriteAudioTags { get; set; }
bool ScrubAudioTags { get; set; }
+ bool EmbedCoverArt { get; set; }
// Forms Auth
string RijndaelPassphrase { get; }
diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json
index c08cf304d..9139ebb18 100644
--- a/src/NzbDrone.Core/Localization/Core/en.json
+++ b/src/NzbDrone.Core/Localization/Core/en.json
@@ -402,6 +402,8 @@
"EditSelectedDownloadClients": "Edit Selected Download Clients",
"EditSelectedImportLists": "Edit Selected Import Lists",
"EditSelectedIndexers": "Edit Selected Indexers",
+ "EmbedCoverArtInAudioFiles": "Embed Cover Art In Audio Files",
+ "EmbedCoverArtHelpText": "Embed Lidarr album art into audio files when writing tags",
"Enable": "Enable",
"EnableAutomaticAdd": "Enable Automatic Add",
"EnableAutomaticAddHelpText": "Add artist/albums to {appName} when syncs are performed via the UI or by {appName}",
diff --git a/src/NzbDrone.Core/MediaFiles/AudioTagService.cs b/src/NzbDrone.Core/MediaFiles/AudioTagService.cs
index 6c0bdc4f3..49554d719 100644
--- a/src/NzbDrone.Core/MediaFiles/AudioTagService.cs
+++ b/src/NzbDrone.Core/MediaFiles/AudioTagService.cs
@@ -80,21 +80,25 @@ namespace NzbDrone.Core.MediaFiles
var albumartist = album.Artist.Value;
var artist = track.ArtistMetadata.Value;
- var cover = album.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Cover);
string imageFile = null;
long imageSize = 0;
- if (cover != null)
+
+ if (_configService.EmbedCoverArt)
{
- imageFile = _mediaCoverService.GetCoverPath(album.Id, MediaCoverEntity.Album, cover.CoverType, cover.Extension, null);
- _logger.Trace($"Embedding: {imageFile}");
- var fileInfo = _diskProvider.GetFileInfo(imageFile);
- if (fileInfo.Exists)
- {
- imageSize = fileInfo.Length;
- }
- else
+ var cover = album.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Cover);
+ if (cover != null)
{
- imageFile = null;
+ imageFile = _mediaCoverService.GetCoverPath(album.Id, MediaCoverEntity.Album, cover.CoverType, cover.Extension, null);
+ _logger.Trace($"Embedding: {imageFile}");
+ var fileInfo = _diskProvider.GetFileInfo(imageFile);
+ if (fileInfo.Exists)
+ {
+ imageSize = fileInfo.Length;
+ }
+ else
+ {
+ imageFile = null;
+ }
}
}