mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-13 20:02:27 +00:00
[import_functions] Improve header documentation
This commit is contained in:
parent
7890f15146
commit
7716463be2
1 changed files with 53 additions and 58 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue