Skip to content

Commit eb5e025

Browse files
committed
Merge branch 'zductiv-addreleasegroupid'
2 parents 85f6da9 + 59807af commit eb5e025

File tree

14 files changed

+886
-585
lines changed

14 files changed

+886
-585
lines changed

src/TagLib/Ape/Tag.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,8 +1388,27 @@ public override DateTime? DateTagged
13881388
public override string MusicBrainzArtistId {
13891389
get {return GetItemAsString ("MUSICBRAINZ_ARTISTID");}
13901390
set {SetValue ("MUSICBRAINZ_ARTISTID", value);}
1391-
}
1392-
1391+
}
1392+
1393+
/// <summary>
1394+
/// Gets and sets the MusicBrainz Release Group ID of the media
1395+
/// represented by the current instance.
1396+
/// </summary>
1397+
/// <value>
1398+
/// A <see cref="string" /> object containing the MusicBrainz
1399+
/// ReleaseGroupID for the media represented by the current instance
1400+
/// or <see langword="null" /> if no value is present.
1401+
/// </value>
1402+
/// <remarks>
1403+
/// This property is implemented using the "MUSICBRAINZ_RELEASEGROUPID" item.
1404+
/// http://musicbrainz.org/doc/PicardTagMapping
1405+
/// </remarks>
1406+
public override string MusicBrainzReleaseGroupId
1407+
{
1408+
get { return GetItemAsString("MUSICBRAINZ_RELEASEGROUPID"); }
1409+
set { SetValue("MUSICBRAINZ_RELEASEGROUPID", value); }
1410+
}
1411+
13931412
/// <summary>
13941413
/// Gets and sets the MusicBrainz Release ID of the media
13951414
/// represented by the current instance.

src/TagLib/Asf/Tag.cs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ public IEnumerable<ContentDescriptor> GetDescriptors (params string [] names)
343343
/// method, which are used for removing existing values and
344344
/// determining where to position the new objects.
345345
/// </remarks>
346-
public void SetDescriptors (string name,
347-
params ContentDescriptor [] descriptors)
346+
public void SetDescriptors (string name,
347+
params ContentDescriptor [] descriptors)
348348
{
349349
if (name == null)
350350
throw new ArgumentNullException ("name");
@@ -1201,8 +1201,28 @@ public override string Copyright {
12011201
public override string MusicBrainzArtistId {
12021202
get {return GetDescriptorString ("MusicBrainz/Artist Id");}
12031203
set {SetDescriptorString (value, "MusicBrainz/Artist Id");}
1204-
}
1205-
1204+
}
1205+
1206+
/// <summary>
1207+
/// Gets and sets the MusicBrainz Release Group ID of
1208+
/// the media described by the current instance.
1209+
/// </summary>
1210+
/// <value>
1211+
/// A <see cref="string" /> containing the MusicBrainz
1212+
/// ReleaseGroupID for the media described by the current
1213+
/// instance or null if no value is present.
1214+
/// </value>
1215+
/// <remarks>
1216+
/// This property is implemented using the "MusicBrainz/Release Group Id"
1217+
/// field.
1218+
/// http://musicbrainz.org/doc/PicardTagMapping
1219+
/// </remarks>
1220+
public override string MusicBrainzReleaseGroupId
1221+
{
1222+
get { return GetDescriptorString("MusicBrainz/Release Group Id"); }
1223+
set { SetDescriptorString(value, "MusicBrainz/Release Group Id"); }
1224+
}
1225+
12061226
/// <summary>
12071227
/// Gets and sets the MusicBrainz Release ID of
12081228
/// the media described by the current instance.

src/TagLib/CombinedTag.cs

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,8 +1270,47 @@ public override string MusicBrainzArtistId {
12701270
if (tag != null)
12711271
tag.MusicBrainzArtistId = value;
12721272
}
1273-
}
1274-
1273+
}
1274+
1275+
/// <summary>
1276+
/// Gets and sets the MusicBrainz Release Group ID.
1277+
/// </summary>
1278+
/// <value>
1279+
/// A <see cref="string" /> containing the MusicBrainz
1280+
/// ReleaseGroupID for the media described by the
1281+
/// current instance or null if no value is present.
1282+
/// </value>
1283+
/// <remarks>
1284+
/// <para>When getting the value, the child tags are looped
1285+
/// through in order and the first non-<see langword="null" />
1286+
/// and non-empty value is returned.</para>
1287+
/// <para>When setting the value, it is stored in each child
1288+
/// tag.</para>
1289+
/// </remarks>
1290+
/// <seealso cref="Tag.MusicBrainzReleaseGroupId" />
1291+
public override string MusicBrainzReleaseGroupId {
1292+
get {
1293+
foreach (Tag tag in tags)
1294+
{
1295+
if (tag == null)
1296+
continue;
1297+
1298+
string value = tag.MusicBrainzReleaseGroupId;
1299+
1300+
if (value != null)
1301+
return value;
1302+
}
1303+
1304+
return null;
1305+
}
1306+
1307+
set {
1308+
foreach (Tag tag in tags)
1309+
if (tag != null)
1310+
tag.MusicBrainzReleaseGroupId = value;
1311+
}
1312+
}
1313+
12751314
/// <summary>
12761315
/// Gets and sets the MusicBrainz Release ID.
12771316
/// </summary>

src/TagLib/Id3v2/Tag.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,8 +2037,25 @@ public override DateTime? DateTagged
20372037
public override string MusicBrainzArtistId {
20382038
get {return GetUserTextAsString ("MusicBrainz Artist Id");}
20392039
set {SetUserTextAsString ("MusicBrainz Artist Id",value);}
2040-
}
2041-
2040+
}
2041+
2042+
/// <summary>
2043+
/// Gets and sets the MusicBrainz ReleaseGroupID
2044+
/// </summary>
2045+
/// <value>
2046+
/// A <see cref="string" /> containing the MusicBrainz
2047+
/// ReleaseGroupID for the media described by the current
2048+
/// instance, or null if no value is present.
2049+
/// </value>
2050+
/// <remarks>
2051+
/// This property is implemented using the "TXXX:MusicBrainz Release Group Id" frame.
2052+
/// http://musicbrainz.org/doc/PicardTagMapping
2053+
/// </remarks>
2054+
public override string MusicBrainzReleaseGroupId {
2055+
get { return GetUserTextAsString("MusicBrainz Release Group Id"); }
2056+
set { SetUserTextAsString("MusicBrainz Release Group Id", value); }
2057+
}
2058+
20422059
/// <summary>
20432060
/// Gets and sets the MusicBrainz ReleaseID
20442061
/// </summary>
@@ -2086,8 +2103,8 @@ public override string MusicBrainzReleaseArtistId {
20862103
/// http://musicbrainz.org/doc/PicardTagMapping
20872104
/// </remarks>
20882105
public override string MusicBrainzTrackId {
2089-
get { return GetUfidText ("http://musicbrainz.org");}
2090-
set {SetUfidText ("http://musicbrainz.org", value);}
2106+
get { return GetUfidText ("http://musicbrainz.org");}
2107+
set {SetUfidText ("http://musicbrainz.org", value);}
20912108
}
20922109

20932110
/// <summary>

src/TagLib/Matroska/Tag.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,23 @@ public override string MusicBrainzArtistId
12311231
{
12321232
get { return null; }
12331233
set { }
1234-
}
1235-
1234+
}
1235+
1236+
/// <summary>
1237+
/// Gets and sets the MusicBrainz Release Group ID of
1238+
/// the media described by the current instance.
1239+
/// </summary>
1240+
/// <value>
1241+
/// A <see cref="string" /> containing the MusicBrainz
1242+
/// ReleaseGroupID for the media described by the current
1243+
/// instance or null if no value is present.
1244+
/// </value>
1245+
public override string MusicBrainzReleaseGroupId
1246+
{
1247+
get { return null; }
1248+
set { }
1249+
}
1250+
12361251
/// <summary>
12371252
/// Gets and sets the MusicBrainz Release ID of
12381253
/// the media described by the current instance.

src/TagLib/Mpeg4/AppleTag.cs

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ public IEnumerable<AppleDataBox> DataBoxes (params ByteVector [] types)
179179
/// A <see cref="T:System.Collections.Generic.IEnumerable`1" /> object enumerating the
180180
/// matching boxes.
181181
/// </returns>
182-
public IEnumerable<AppleDataBox> DataBoxes (string mean,
183-
string name)
182+
public IEnumerable<AppleDataBox> DataBoxes (string mean, string name)
184183
{
185184
// These children will have a box type of "----"
186185
foreach (Box box in ilst_box.Children) {
@@ -331,16 +330,15 @@ public void SetData (ByteVector type, ByteVectorCollection data,
331330
/// A <see cref="uint" /> value containing flags to use for
332331
/// the added box.
333332
/// </param>
334-
public void SetData (ByteVector type, ByteVector data,
335-
uint flags)
333+
public void SetData (ByteVector type, ByteVector data, uint flags)
336334
{
337335
if (data == null || data.Count == 0)
338336
ClearData (type);
339337
else
340338
SetData (type, new ByteVectorCollection (data),
341339
flags);
342340
}
343-
341+
344342
/// <summary>
345343
/// Sets the text for a specified box type.
346344
/// </summary>
@@ -1338,8 +1336,25 @@ public override string TitleSort {
13381336
public override string MusicBrainzArtistId {
13391337
get {return GetDashBox("com.apple.iTunes","MusicBrainz Artist Id");}
13401338
set {SetDashBox("com.apple.iTunes", "MusicBrainz Artist Id", value);}
1341-
}
1342-
1339+
}
1340+
1341+
/// <summary>
1342+
/// Gets and sets the MusicBrainz ReleaseGroupID
1343+
/// </summary>
1344+
/// <value>
1345+
/// A <see cref="string" /> containing the MusicBrainz
1346+
/// ReleaseGroupID for the media described by the current
1347+
/// instance, or null if no value is present.
1348+
/// </value>
1349+
/// <remarks>
1350+
/// This property is implemented using the "dash"/"----" box type.
1351+
/// http://musicbrainz.org/doc/PicardTagMapping
1352+
/// </remarks>
1353+
public override string MusicBrainzReleaseGroupId {
1354+
get { return GetDashBox("com.apple.iTunes", "MusicBrainz Release Group Id"); }
1355+
set { SetDashBox("com.apple.iTunes", "MusicBrainz Release Group Id", value); }
1356+
}
1357+
13431358
/// <summary>
13441359
/// Gets and sets the MusicBrainz ReleaseID
13451360
/// </summary>
@@ -1387,8 +1402,8 @@ public override string MusicBrainzReleaseArtistId {
13871402
/// http://musicbrainz.org/doc/PicardTagMapping
13881403
/// </remarks>
13891404
public override string MusicBrainzTrackId {
1390-
get {return GetDashBox("com.apple.iTunes","MusicBrainz Track Id");}
1391-
set {SetDashBox("com.apple.iTunes", "MusicBrainz Track Id", value);}
1405+
get {return GetDashBox("com.apple.iTunes","MusicBrainz Track Id");}
1406+
set {SetDashBox("com.apple.iTunes", "MusicBrainz Track Id", value);}
13921407
}
13931408

13941409
/// <summary>

0 commit comments

Comments
 (0)