AlbumArtistTag class final

Represents an album artist metadata tag for audio files.

AlbumArtistTag contains the primary artist of the album, which may differ from the track artist. This field is commonly used in compilation albums, soundtracks, or albums featuring guest artists where the album artist differs from individual track artists. If not explicitly set, it often defaults to the track artist.

Format mappings:

  • ID3v2: TPE2 frame
  • Vorbis: ALBUMARTIST field
  • MP4: aART atom
  • ID3v1: Not supported (will be omitted)

Example usage:

// Create a basic album artist tag
final albumArtistTag = AlbumArtistTag('Various Artists');

// Create with provenance information
final albumArtistWithProvenance = AlbumArtistTag(
  'Various Artists',
  provenance: TagProvenance(
    ContainerKind.id3v2,
    '2.4',
    TagConfidence.certain,
  ),
);

// Update provenance immutably
final updatedTag = albumArtistTag.withProvenance(
  TagProvenance(ContainerKind.vorbis, '', TagConfidence.certain),
);

The album artist value should be a non-empty string containing the artist name. Different container formats may have length limitations that are handled automatically during encoding operations.

Inheritance

Constructors

AlbumArtistTag(String value, {TagProvenance provenance = const TagProvenance.none()})
Creates a new AlbumArtistTag with the specified album artist value.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
key TagKey
The semantic field type that this tag represents.
finalinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setterinherited
provenance TagProvenance
Provenance information tracking the origin and reliability of this tag.
finalinherited
requiresAsyncPreparation bool
Whether this tag requires async data loading before encoding.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
value String
The actual metadata value stored in this tag.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareForEncoding() Future<MetadataTag<String>>
Prepares the tag for synchronous encoding by loading any async data.
inherited
prepareForEncodingAsync() Future<MetadataTag<String>>
Prepares the tag for synchronous encoding by loading any async data.
inherited
toJson() Map<String, dynamic>
Converts this AlbumArtistTag to a JSON-serializable Map.
toString() String
A string representation of this object.
inherited
withProvenance(TagProvenance newProvenance) AlbumArtistTag
Creates a new AlbumArtistTag instance with updated provenance information.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromJson(Map<String, dynamic> json) AlbumArtistTag
Creates an AlbumArtistTag from a JSON Map.