Skip to content

Commit

Permalink
Disregard case in Apple box names + initial unit test (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
teekay authored and decriptor committed Nov 27, 2019
1 parent e00eca6 commit b27beab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/TaglibSharp.Tests/FileFormats/M4aFormatTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public Mpeg4TestFile (string path) : base (path)
}

static readonly string sample_file = TestPath.Samples + "sample.m4a";
static readonly string sample_file_rg = TestPath.Samples + "sample_replaygain.m4a";
static readonly string tmp_file = TestPath.Samples + "tmpwrite.m4a";
static readonly string aac_broken_tags = TestPath.Samples + "bgo_658920.m4a";
TagLib.File file;
Expand Down Expand Up @@ -93,6 +94,13 @@ public void ReadTags ()
Assert.AreEqual (1234, file.Tag.Year);
}

[Test]
public void ReadReplayGain()
{
var fileWithRg = TagLib.File.Create (sample_file_rg);
Assert.AreEqual(-1.43, fileWithRg.Tag.ReplayGainTrackGain, 0.01);
}

[Test]
public void WriteStandardTags ()
{
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion src/TaglibSharp/Mpeg4/AppleTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ AppleDataBox GetDashAtoms (string meanstring, string namestring)

if (mean_box == null || name_box == null ||
mean_box.Text != meanstring ||
name_box.Text != namestring) {
!name_box.Text.Equals (namestring, StringComparison.OrdinalIgnoreCase)) {
continue;
} else {
return (AppleDataBox)box.GetChild (BoxType.Data);
Expand Down

0 comments on commit b27beab

Please sign in to comment.