[import_functions] Improve header documentation

This commit is contained in:
Aurélien Mino 2015-01-18 13:34:10 +01:00
parent 7890f15146
commit 7716463be2

View file

@ -3,63 +3,58 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
- First build a 'release' object that you'll fill in with your source of data
- Call as follows, e.g.:
var parameters = MBReleaseImportHelper.buildFormParameters( theParsedRelease, optionalEditNote );
- Then build the HTML that you'll inject into source site page:
var formHtml = MBReleaseImportHelper.buildFormHTML( parameters );
- Addinionally, you can inject a search link to verify that the release is not already known by MusicBrainz:
var linkHtml = MBReleaseImportHelper.buildSearchLink( theParsedRelease );
--- 'release' object format : ---
release = {
title,
artist_credit = [ { name: '',
type,
status,
language,
script,
packaging,
country,
year,
month,
day,
labels = [ { name, mbid, catno }, ... ],
barcode,
urls = [ {url, link_type }, ... ],
discs = [
{
title,
format,
tracks = [
{ number, title, duration, artist_credit },
...
]
},
...
],
}
where 'artist_credit' has the following format:
artist_credit = [
{
credited_name,
artist_name,
artist_mbid,
joinphrase
},
...
]
* How to use this module?
*
* - First build a release object (see expected format below) that you'll fill in from source of data
* - Call as follows, e.g.:
* var parameters = MBReleaseImportHelper.buildFormParameters(parsedRelease, optionalEditNote);
* - Then build the HTML that you'll inject into source site page:
* var formHtml = MBReleaseImportHelper.buildFormHTML(parameters);
* - Addinionally, you can inject a search link to verify that the release is not already known by MusicBrainz:
* var linkHtml = MBReleaseImportHelper.buildSearchLink(parsedRelease);
*
* Expected format of release object:
*
* release = {
* title,
* artist_credit,
* type,
* status,
* language,
* script,
* packaging,
* country,
* year,
* month,
* day,
* labels = [ { name, mbid, catno }, ... ],
* barcode,
* urls = [ {url, link_type }, ... ],
* discs = [
* {
* title,
* format,
* tracks = [
* { number, title, duration, artist_credit },
* ...
* ]
* },
* ...
* ],
* }
*
* where 'artist_credit' has the following format:
*
* artist_credit = [
* {
* credited_name,
* artist_name,
* artist_mbid,
* joinphrase
* },
* ...
* ]
*
*/
var MBReleaseImportHelper = (function() {