CUERipper: When ripping disc a second time without reloading,

album art was added to file twice
This commit is contained in:
Grigory Chudov
2013-04-28 12:35:07 -04:00
parent f430157812
commit e0f3f7c4bd
3 changed files with 7 additions and 9 deletions

View File

@@ -176,6 +176,10 @@
<Project>{8DD1E84B-0B03-4C0B-9B42-1E49F75E7CB1}</Project>
<Name>ProgressODoom</Name>
</ProjectReference>
<ProjectReference Include="..\taglib-sharp\src\taglib-sharp.csproj">
<Project>{6B143A39-C7B2-4743-9917-92262C60E9A6}</Project>
<Name>taglib-sharp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\musicbrainz.ico" />

View File

@@ -477,11 +477,13 @@ namespace CUERipper
bnComboBoxOutputFormat.Items.RemoveAt(OutputPathUseTemplates.Length + 10);
}
cueSheet.AlbumArt.Clear();
if (currentAlbumArt >= 0 && currentAlbumArt < albumArt.Count)
{
data.selectedRelease.metadata.AlbumArt.Clear();
data.selectedRelease.metadata.AlbumArt.Add(albumArt[currentAlbumArt].meta);
cueSheet.AddAlbumArt(albumArt[currentAlbumArt].contents);
var blob = new TagLib.ByteVector(albumArt[currentAlbumArt].contents);
cueSheet.AlbumArt.Add(new TagLib.Picture(blob) { Type = TagLib.PictureType.FrontCover });
}
data.selectedRelease.metadata.Save();

View File

@@ -2956,14 +2956,6 @@ namespace CUETools.Processor
}
}
public void AddAlbumArt(byte[] encoded)
{
var data = new TagLib.ByteVector(encoded);
var picture = new TagLib.Picture(data);
picture.Type = TagLib.PictureType.FrontCover;
_albumArt.Add(picture);
}
public void ResizeAlbumArt()
{
if (_albumArt == null)