-
Notifications
You must be signed in to change notification settings - Fork 0
TitleSearchAdvanced class
You can use this class to do advanced searches on musicBrainz API
There are a few methods:
searchArtist() (not the same as search from TitleSearch, results are different)
fetchReleaseGroups()
releaseGroupReleases()
$music = new \Music\TitleSearchAdvanced();
Search only specific in artist entity of musicBrainz
Search results are limited to 25
searchArtist($artistName);
@parameter $artistName input search artist text
$results = $music->searchArtist("AC/DC");
@return Artist[] array of Artists
[id] (string) Artist id [name] (string) Artist name [area] (string) Area Like Australia [description] (string) short description of this Artist or Group [type] (string) type like group or person
Search for all release groups for a specific artist ID
Results array is sorted on release date, oldest first
Paging is used if more than 100 results, this will take some time!
This has to do with musicBrainz API restrictions of 1 request per second
Results can be cached (set in config, see wiki)
fetchReleaseGroups($artistId, $type);
@parameter string $artistId input artist ID found with searchArtist()
@parameter string $type Include only this type in search, exclude all others, Default: discography
@parameter string $sortOrder ASC or DESC, Default: ASC
Possible values for $type:
album (only albums with strictly primarytype album are included, excluding all others) discography (musicBrainz website defaults are included, Singles are excluded) all (all types are included, returns all available releaseGroups)
$results = $music->fetchReleaseGroups("66c662b6-6e2f-4930-8610-912e24c63ed1", "album");
@return releaseGroups[] array of release groups
[id] (string) release group ID [title] (string) release group title [artist] (string) release group Artist name/group [date] (string) release date of this release group [totalReleasesCount] (int) total release group count [primaryType] (string) primary type like album [secondaryType] (array) secondary type like live
Search for all Various Artists releasegroups of specific artistId
Results array is sorted on release date, oldest first
At the moment max results is 25 as paging is not possible
fetchReleaseGroupsVarious($artistId);
@parameter string $artistId input artist ID found with searchArtist()
@parameter string $sortOrder ASC or DESC, Default: ASC
$results = $music->fetchReleaseGroupsVarious("66c662b6-6e2f-4930-8610-912e24c63ed1");
@return releaseGroups[] array of release groups
[id] (string) release group ID [title] (string) release group title [date] (string) release date of this release group
Search for all releases from a specific release group ID
Search results are limited to 100 (if that is not enough let me know as paging is required)
Results array is sorted on release date, oldest first
Results can be cached (set in config, see wiki)
fetchReleaseGroups($relGroupId);
@parameter string $relGroupId input release group ID found with fetchReleaseGroups()
@parameter string $sortOrder ASC or DESC, Default: ASC
$results = $music->releaseGroupReleases("2b81e645-4586-4456-843a-9bc19a217470");
@return releaseGroupReleases[] array of release group releases
[id] (string) release ID [title] (string) release title [artist] (string) release Artist name/group [date] (string) release date of this release [status] (string) status of this release like official [barcode] (int) barcode found on back cover [countryCode] (string) countryCode of release e.g US (or Continent: XE for Europe, XW for WorldWide) [labels] (array) all labels this release is released on [name] => (string) Label name [id] => (string) Label ID [catalog] => (string) Label catalog number [media] (array) media info like format and track count [format] => (string) Format of this release like CD or vinyl [trackCount] => (int) total track count of this release