Skip to content

Commit e2a26a9

Browse files
committed
Merge branch 'addreleasegroupid' of git://github.com/zductiv/taglib-sharp into zductiv-addreleasegroupid
2 parents 85f6da9 + 8d69b33 commit e2a26a9

File tree

14 files changed

+439
-106
lines changed

14 files changed

+439
-106
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: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ public string [] GetDescriptorStrings (params string [] names)
229229
/// The value will be stored in the first value in <paramref
230230
/// name="names" /> and the rest will be cleared.
231231
/// </remarks>
232-
public void SetDescriptorString (string value,
233-
params string [] names)
232+
public void SetDescriptorString (string value,
233+
params string [] names)
234234
{
235235
if (names == null)
236236
throw new ArgumentNullException ("names");
@@ -268,8 +268,8 @@ public void SetDescriptorString (string value,
268268
/// The value will be stored in the first value in <paramref
269269
/// name="names" /> and the rest will be cleared.
270270
/// </remarks>
271-
public void SetDescriptorStrings (string [] value,
272-
params string [] names)
271+
public void SetDescriptorStrings (string [] value,
272+
params string [] names)
273273
{
274274
if (names == null)
275275
throw new ArgumentNullException ("names");
@@ -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: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,8 +1270,50 @@ 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+
{
1293+
get
1294+
{
1295+
foreach (Tag tag in tags)
1296+
{
1297+
if (tag == null)
1298+
continue;
1299+
1300+
string value = tag.MusicBrainzReleaseGroupId;
1301+
1302+
if (value != null)
1303+
return value;
1304+
}
1305+
1306+
return null;
1307+
}
1308+
1309+
set
1310+
{
1311+
foreach (Tag tag in tags)
1312+
if (tag != null)
1313+
tag.MusicBrainzReleaseGroupId = value;
1314+
}
1315+
}
1316+
12751317
/// <summary>
12761318
/// Gets and sets the MusicBrainz Release ID.
12771319
/// </summary>

src/TagLib/Id3v2/Tag.cs

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ public void RemoveFrames (ByteVector ident)
457457
/// <exception cref="ArgumentException">
458458
/// <paramref name="ident" /> is not exactly four bytes long.
459459
/// </exception>
460-
public void SetTextFrame (ByteVector ident,
461-
params string [] text)
460+
public void SetTextFrame (ByteVector ident,
461+
params string [] text)
462462
{
463463
if (ident == null)
464464
throw new ArgumentNullException ("ident");
@@ -517,8 +517,8 @@ public void SetTextFrame (ByteVector ident,
517517
/// <paramref name="ident" /> is not exactly four bytes long.
518518
/// </exception>
519519
[Obsolete("Use SetTextFrame(ByteVector,String[])")]
520-
public void SetTextFrame (ByteVector ident,
521-
StringCollection text)
520+
public void SetTextFrame (ByteVector ident,
521+
StringCollection text)
522522
{
523523
if (text == null || text.Count == 0)
524524
RemoveFrames (ident);
@@ -562,8 +562,8 @@ public void SetTextFrame (ByteVector ident,
562562
/// <exception cref="ArgumentException">
563563
/// <paramref name="ident" /> is not exactly four bytes long.
564564
/// </exception>
565-
public void SetNumberFrame (ByteVector ident, uint number,
566-
uint count, string format = "0")
565+
public void SetNumberFrame (ByteVector ident, uint number,
566+
uint count, string format = "0")
567567
{
568568
if (ident == null)
569569
throw new ArgumentNullException ("ident");
@@ -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: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ 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,
183+
string name)
184184
{
185185
// These children will have a box type of "----"
186186
foreach (Box box in ilst_box.Children) {
@@ -300,8 +300,8 @@ public void SetData (ByteVector type, AppleDataBox [] boxes)
300300
/// A <see cref="uint" /> value containing flags to use for
301301
/// the added boxes.
302302
/// </param>
303-
public void SetData (ByteVector type, ByteVectorCollection data,
304-
uint flags)
303+
public void SetData (ByteVector type, ByteVectorCollection data,
304+
uint flags)
305305
{
306306
if (data == null || data.Count == 0) {
307307
ClearData (type);
@@ -331,16 +331,16 @@ public void SetData (ByteVector type, ByteVectorCollection data,
331331
/// A <see cref="uint" /> value containing flags to use for
332332
/// the added box.
333333
/// </param>
334-
public void SetData (ByteVector type, ByteVector data,
335-
uint flags)
334+
public void SetData (ByteVector type, ByteVector data,
335+
uint flags)
336336
{
337337
if (data == null || data.Count == 0)
338338
ClearData (type);
339339
else
340340
SetData (type, new ByteVectorCollection (data),
341341
flags);
342342
}
343-
343+
344344
/// <summary>
345345
/// Sets the text for a specified box type.
346346
/// </summary>
@@ -1338,8 +1338,25 @@ public override string TitleSort {
13381338
public override string MusicBrainzArtistId {
13391339
get {return GetDashBox("com.apple.iTunes","MusicBrainz Artist Id");}
13401340
set {SetDashBox("com.apple.iTunes", "MusicBrainz Artist Id", value);}
1341-
}
1342-
1341+
}
1342+
1343+
/// <summary>
1344+
/// Gets and sets the MusicBrainz ReleaseGroupID
1345+
/// </summary>
1346+
/// <value>
1347+
/// A <see cref="string" /> containing the MusicBrainz
1348+
/// ReleaseGroupID for the media described by the current
1349+
/// instance, or null if no value is present.
1350+
/// </value>
1351+
/// <remarks>
1352+
/// This property is implemented using the "dash"/"----" box type.
1353+
/// http://musicbrainz.org/doc/PicardTagMapping
1354+
/// </remarks>
1355+
public override string MusicBrainzReleaseGroupId {
1356+
get { return GetDashBox("com.apple.iTunes", "MusicBrainz Release Group Id"); }
1357+
set { SetDashBox("com.apple.iTunes", "MusicBrainz Release Group Id", value); }
1358+
}
1359+
13431360
/// <summary>
13441361
/// Gets and sets the MusicBrainz ReleaseID
13451362
/// </summary>
@@ -1387,8 +1404,8 @@ public override string MusicBrainzReleaseArtistId {
13871404
/// http://musicbrainz.org/doc/PicardTagMapping
13881405
/// </remarks>
13891406
public override string MusicBrainzTrackId {
1390-
get {return GetDashBox("com.apple.iTunes","MusicBrainz Track Id");}
1391-
set {SetDashBox("com.apple.iTunes", "MusicBrainz Track Id", value);}
1407+
get {return GetDashBox("com.apple.iTunes","MusicBrainz Track Id");}
1408+
set {SetDashBox("com.apple.iTunes", "MusicBrainz Track Id", value);}
13921409
}
13931410

13941411
/// <summary>

0 commit comments

Comments
 (0)