musicbrainz

package module
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: OSL-3.0 Imports: 5 Imported by: 1

README

MusicBrainz

Soon I’ll have the courage
To leave my thoughts behind
I’ll give back all the knowledge
And keep the wisdom precious in my mind

Massive Attack (1994)

Release 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

Overview

MusicBrainz

Index

Constants

View Source
const (
	API = "http://musicbrainz.org/ws/2/release"
)

Variables

View Source
var Status = map[string]int{"Official": 0, "Bootleg": 1}

Functions

This section is empty.

Types

type Group added in v1.16.4

type Group struct {
	ReleaseCount int `json:"release-count"`
	Releases     []Release
}

func GroupFromArtist added in v1.16.9

func GroupFromArtist(artistID string, offset int) (*Group, error)

func NewGroup added in v1.16.4

func NewGroup(groupID string) (*Group, error)

func (Group) Sort added in v1.16.4

func (g Group) Sort()

type Release

type Release struct {
	ArtistCredit []struct {
		Name   string
		Artist struct {
			ID string
		}
	} `json:"artist-credit"`
	Date  string
	Media []struct {
		TrackCount int `json:"track-count"`
		Tracks     []struct {
			Length int
			Title  string
		}
	}
	ReleaseGroup struct {
		FirstReleaseDate string `json:"first-release-date"`
		ID               string
		SecondaryTypes   []string `json:"secondary-types"`
		Title            string
	} `json:"release-group"`
	Status string
	Title  string
}

func NewRelease

func NewRelease(releaseID string) (*Release, error)

Jump to

Keyboard shortcuts

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