Skip to content

Commit 507293d

Browse files
committed
Added support for Reading and Writing Multiple MusicBrainzArtistIds and MusicBrainzReleaseArtistIds
1 parent d4a75ba commit 507293d

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/TaglibSharp/Ogg/XiphComment.cs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
using System.Collections;
3030
using System.Collections.Generic;
3131
using System.Globalization;
32+
using System.Linq;
3233

3334
namespace TagLib.Ogg
3435
{
@@ -1213,8 +1214,14 @@ public override DateTime? DateTagged {
12131214
/// This property is implemented using the "MUSICBRAINZ_ARTISTID" field.
12141215
/// </remarks>
12151216
public override string MusicBrainzArtistId {
1216-
get { return GetFirstField ("MUSICBRAINZ_ARTISTID"); }
1217-
set { SetField ("MUSICBRAINZ_ARTISTID", value); }
1217+
get {
1218+
string[] artistIds = GetField ("MUSICBRAINZ_ARTISTID");
1219+
return string.Join ("/", artistIds);
1220+
}
1221+
set {
1222+
string[] artistIds = value.Split ('/');
1223+
SetField ("MUSICBRAINZ_ARTISTID", artistIds);
1224+
}
12181225
}
12191226

12201227
/// <summary>
@@ -1264,8 +1271,14 @@ public override string MusicBrainzReleaseId {
12641271
/// This property is implemented using the "MUSICBRAINZ_ALBUMARTISTID" field.
12651272
/// </remarks>
12661273
public override string MusicBrainzReleaseArtistId {
1267-
get { return GetFirstField ("MUSICBRAINZ_ALBUMARTISTID"); }
1268-
set { SetField ("MUSICBRAINZ_ALBUMARTISTID", value); }
1274+
get {
1275+
string[] releaseArtistIds = GetField ("MUSICBRAINZ_ALBUMARTISTID");
1276+
return string.Join ("/", releaseArtistIds);
1277+
}
1278+
set {
1279+
string[] releaseArtistIds = value.Split ('/');
1280+
SetField ("MUSICBRAINZ_ALBUMARTISTID", releaseArtistIds);
1281+
}
12691282
}
12701283

12711284
/// <summary>

0 commit comments

Comments
 (0)