New: Option to disable cover art embed in files

Fixes #2488
pull/4547/head
Qstick 9 months ago
parent aecf5bba49
commit 885d9903cf

@ -61,6 +61,23 @@ function MetadataProvider(props) {
/>
</FormGroup>
{
settings.writeAudioTags.value !== 'no' &&
<FormGroup>
<FormLabel>
{translate('EmbedCoverArtInAudioFiles')}
</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="embedCoverArt"
helpText={translate('EmbedCoverArtHelpText')}
onChange={onInputChange}
{...settings.embedCoverArt}
/>
</FormGroup>
}
<FormGroup>
<FormLabel>
{translate('ScrubExistingTags')}

@ -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,
};
}
}

@ -65,6 +65,10 @@ namespace NzbDrone.Core.Test.MediaFiles.AudioTagServiceFixture
.Setup(x => x.WriteAudioTags)
.Returns(WriteAudioTagsType.Sync);
Mocker.GetMock<IConfigService>()
.Setup(x => x.EmbedCoverArt)
.Returns(true);
var imageFile = Path.Combine(_testdir, "nin.png");
var imageSize = _diskProvider.GetFileSize(imageFile);

@ -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); }

@ -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; }

@ -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}",

@ -80,9 +80,12 @@ 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 (_configService.EmbedCoverArt)
{
var cover = album.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Cover);
if (cover != null)
{
imageFile = _mediaCoverService.GetCoverPath(album.Id, MediaCoverEntity.Album, cover.CoverType, cover.Extension, null);
@ -97,6 +100,7 @@ namespace NzbDrone.Core.MediaFiles
imageFile = null;
}
}
}
return new AudioTag
{

Loading…
Cancel
Save