musicbrainz

package
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2023 License: OSL-3.0 Imports: 7 Imported by: 0

README

MusicBrainz

If you add a new release, the release group is created at the same time. Be sure to include:

  • release title
  • artist
  • type
  • status
  • date
  • country
  • label
  • release link
  • format
  • track titles
  • track lengths

https://wiki.musicbrainz.org/MusicBrainz_API

Release length

The minimum is 179.5 seconds, which rounds up to 180 seconds, which is 3 minutes. A pathological example is here:

<track id="b9346c0a-1166-30e7-aba3-997ef3065abd">
   <position>4</position>
   <number>4</number>
   <length>179600</length>
   <recording id="0393ce29-889d-4e9a-930e-c110bb87626d">
      <title>In Our Angelhood</title>
      <length>179600</length>
   </recording>
</track>

https://musicbrainz.org/ws/2/release/fed8322a-e8d7-4c65-867b-1697f6204395?inc=recordings

measured by the millisecond, this track is too short. Measured by the second, this track is long enough. Listed here at 2:59:

https://youtube.com/watch?v=JVx0li_Hihk

Listed here at 3:00:

https://musicbrainz.org/release/fed8322a-e8d7-4c65-867b-1697f6204395

Listed here at 3:01:

https://youtube.com/watch?v=tNk-mlgXRp4

To resolve this, we need to round to the second before making any decisions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Release

type Release struct {
	Artist_Credit []struct {
		Name   string
		Artist struct {
			ID string
		}
	} `json:"artist-credit"`
	Date  string
	Media []struct {
		Track_Count int `json:"track-count"`
		Tracks      []Track
	}
	Release_Group struct {
		First_Release_Date string `json:"first-release-date"`
		ID                 string
		Secondary_Types    []string `json:"secondary-types"`
		Title              string
	} `json:"release-group"`
	Status string
	Title  string
}

func New_Release

func New_Release(release_ID string) (*Release, error)

type Release_Group

type Release_Group struct {
	Release_Count int `json:"release-count"`
	Releases      []*Release
}

func From_Artist

func From_Artist(artist_ID string, offset int) (*Release_Group, error)

func New_Release_Group

func New_Release_Group(group_ID string) (*Release_Group, error)

func (Release_Group) Sort

func (r Release_Group) Sort()

type Track

type Track struct {
	Length float64
	Title  string
}

func (Track) Duration

func (r Track) Duration() time.Duration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL