Package musicbrainz2 :: Module model :: Class ReleaseGroup

[frames] | no frames]

# Class ReleaseGroup

source code

    object --+
             |
        Entity --+
                 |
                ReleaseGroup

Represents a ReleaseGroup.

A ReleaseGroup in MusicBrainz is an Entity which groups several different versions of Release objects (e.g., different editions of the same album).

See Also:
  Release, Entity

Instance Methods

__init__(self, id_=None, title=None) Constructor. | source code

getType(self) Returns the type of this release group. | source code

setType(self, type_) Sets the type of this release group. | source code

getReleases(self) Gets the releases in this release group. | source code

addRelease(self, release) Adds a Release to this release group. | source code

getReleasesOffset(self) Returns the offset of the release list. | source code

setReleasesOffset(self, offset) Sets the offset of the release list. | source code

getReleasesCount(self) Returns the number of releases in this release group. | source code

setReleasesCount(self, value) Sets the number of releases in this release group. | source code

getTitle(self) Returns this release group's title. | source code

setTitle(self, title) Sets the release group's title. | source code

getArtist(self) Returns the main artist of this release group. | source code

setArtist(self, artist) Sets the release group's main artist. | source code

Inherited from `Entity`: `addRelation`, `addTag`, `getId`, `getRating`, `getRelationTargetTypes`, `getRelationTargets`, `getRelations`, `getTag`, `getTags`, `setId`, `setRating` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties
| type The type of this release group.
| releases The list of releases in this release group.
| releasesOffset The offset of the release list.
| releasesCount The total number of releases
| title The title of this release group.
| artist The main artist of this release group
Inherited from `Entity`: `id`, `rating`, `tags` Inherited from `object`: `__class__`

Method Details

### __init__(self, id_=None, title=None)
(Constructor)

source code

Constructor.

Parameters:
  - `id_` - a string containing an absolute URI
  - `title` - a string containing the title
Overrides: object.__init__

### getType(self)

source code

Returns the type of this release group.

To test for release types, you can use the constants Release.TYPE_ALBUM, Release.TYPE_SINGLE, etc.

Returns:
  a string containing an absolute URI, or None.

See Also: musicbrainz2.utils.getReleaseTypeName

### setType(self, type_)

source code

Sets the type of this release group.

Use a constant from the Release class, such as Release.TYPE_ALBUM or Release.TYPE_SINGLE to set the value.

Parameters:
  - `type_` - a string containing an absolute URI, or None.

See Also: musicbrainz2.utils.getReleaseTypeName

### getReleases(self)

source code

Gets the releases in this release group.

Returns:
  a list of Release objects

See Also: Release

### addRelease(self, release)

source code

Adds a Release to this release group.

Parameters:
  - `release` - a Release object

### getReleasesOffset(self)

source code

Returns the offset of the release list.

This is used if the release list is incomplete (i.e., the web service only returned a portion of the releases in this release group).

Returns:
  an integer containing the offset, or None.

See Also: getReleases, getReleasesCount

### setReleasesOffset(self, offset)

source code

Sets the offset of the release list.

Parameters:
  - `offset` - an integer containing the offset, or None.

See Also: getReleases, getReleasesOffset

### getReleasesCount(self)

source code

Returns the number of releases in this release group.

This may or may not match the number of elements returned by getReleases. If the count is higher than the length of that list, then the list is incomplete.

Returns:
  an integer containing the count, or None

See Also: getReleases, setReleasesCount, getReleasesOffset

### setReleasesCount(self, value)

source code

Sets the number of releases in this release group.

Parameters:
  - `value` - an integer containing the count, or None.

See Also: getReleases, getReleasesCount, getReleasesOffset

### getTitle(self)

source code

Returns this release group's title.

Returns:
  a string containing the release group's title

### setTitle(self, title)

source code

Sets the release group's title.

Parameters:
  - `title` - a string containing the release group's title.

### getArtist(self)

source code

Returns the main artist of this release group.

Returns:
  an Artist object, or None

### setArtist(self, artist)

source code

Sets the release group's main artist.

Parameters:
  - `artist` - an Artist object

Property Details

### type

The type of this release group.

Get Method:
  getType(self) - Returns the type of this release group.
Set Method:
  setType(self, type_) - Sets the type of this release group.

### releases

The list of releases in this release group.

Get Method:
  getReleases(self) - Gets the releases in this release group.

### releasesOffset

The offset of the release list.

Get Method:
  getReleasesOffset(self) - Returns the offset of the release list.
Set Method:
  setReleasesOffset(self, offset) - Sets the offset of the release list.

### releasesCount

The total number of releases

Get Method:
  getReleasesCount(self) - Returns the number of releases in this release group.
Set Method:
  setReleasesCount(self, value) - Sets the number of releases in this release group.

### title

The title of this release group.

Get Method:
  getTitle(self) - Returns this release group's title.
Set Method:
  setTitle(self, title) - Sets the release group's title.

### artist

The main artist of this release group

Get Method:
  getArtist(self) - Returns the main artist of this release group.
Set Method:
  setArtist(self, artist) - Sets the release group's main artist.