Skip to content

Commit 0c301f1

Browse files
CodeWithMadecriptor
authored andcommitted
Ogg/GroupedComment: Add MusicBrainzRecordingId, MusicBrainzWorkId
1 parent 62eda56 commit 0c301f1

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

src/TaglibSharp/Ogg/GroupedComment.cs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,66 @@ public override string MusicBrainzTrackId {
11101110
set { if (tags.Count > 0) tags[0].MusicBrainzTrackId = value; }
11111111
}
11121112

1113+
/// <summary>
1114+
/// Gets and sets the MusicBrainz Recording ID.
1115+
/// </summary>
1116+
/// <value>
1117+
/// A <see cref="string" /> containing the MusicBrainz
1118+
/// RecordingID for the media described by the
1119+
/// current instance or null if no value is present.
1120+
/// </value>
1121+
/// <remarks>
1122+
/// <para>When getting the value, the child comments are looped
1123+
/// through in order and the first non-<see langword="null" />
1124+
/// and non-empty value is returned.</para>
1125+
/// <para>When setting the value, it is stored in the first
1126+
/// comment.</para>
1127+
/// </remarks>
1128+
/// <seealso cref="Tag.MusicBrainzRecordingId" />
1129+
public override string MusicBrainzRecordingId {
1130+
get {
1131+
foreach (XiphComment tag in tags) {
1132+
string value = tag?.MusicBrainzRecordingId;
1133+
1134+
if (!string.IsNullOrEmpty (value))
1135+
return value;
1136+
}
1137+
1138+
return null;
1139+
}
1140+
set { if (tags.Count > 0) tags[0].MusicBrainzRecordingId = value; }
1141+
}
1142+
1143+
/// <summary>
1144+
/// Gets and sets the MusicBrainz Work ID.
1145+
/// </summary>
1146+
/// <value>
1147+
/// A <see cref="string" /> containing the MusicBrainz
1148+
/// WorkID for the media described by the
1149+
/// current instance or null if no value is present.
1150+
/// </value>
1151+
/// <remarks>
1152+
/// <para>When getting the value, the child comments are looped
1153+
/// through in order and the first non-<see langword="null" />
1154+
/// and non-empty value is returned.</para>
1155+
/// <para>When setting the value, it is stored in the first
1156+
/// comment.</para>
1157+
/// </remarks>
1158+
/// <seealso cref="Tag.MusicBrainzWorkId" />
1159+
public override string MusicBrainzWorkId {
1160+
get {
1161+
foreach (XiphComment tag in tags) {
1162+
string value = tag?.MusicBrainzWorkId;
1163+
1164+
if (!string.IsNullOrEmpty (value))
1165+
return value;
1166+
}
1167+
1168+
return null;
1169+
}
1170+
set { if (tags.Count > 0) tags[0].MusicBrainzWorkId = value; }
1171+
}
1172+
11131173
/// <summary>
11141174
/// Gets and sets the MusicBrainz Disc ID.
11151175
/// </summary>

0 commit comments

Comments
 (0)