Line up indentations properly.

`sed -E 's/^((    )*) {1,3}([^ ])/\1\3/'`
(Thanks to @warpr and @JonnyJD for help with cracking that one!)
This commit is contained in:
Frederik "Freso" S. Olesen 2014-02-21 19:21:53 +01:00
parent 9f346bc8e4
commit 1a3a2414dc
3 changed files with 49 additions and 49 deletions

View file

@ -24,7 +24,7 @@ function retrieveReleaseInfo() {
release.discs = [];
var bandcampAlbumData = unsafeWindow.TralbumData;
var bandcampEmbedData = unsafeWindow.EmbedData;
var bandcampEmbedData = unsafeWindow.EmbedData;
// Release artist credit
release.artist_credit = [ { artist_name: bandcampAlbumData.artist } ];
@ -35,8 +35,8 @@ function retrieveReleaseInfo() {
// Grab release event information
var releasedate = bandcampAlbumData.current.release_date;
if(bandcampEmbedData.album_title) {
release.parent_album = bandcampEmbedData.album_title;
if(bandcampEmbedData.album_title) {
release.parent_album = bandcampEmbedData.album_title;
}
if (typeof releasedate != "undefined" && releasedate != "") {
@ -52,9 +52,9 @@ function retrieveReleaseInfo() {
release.type = bandcampAlbumData.current.type;
release.status = 'official';
// map Bandcamp single tracks to singles
if(release.type == "track")
{ release.type = "single"; }
// map Bandcamp single tracks to singles
if(release.type == "track")
{ release.type = "single"; }
// Tracks
var disc = new Object();

View file

@ -50,19 +50,19 @@ $(document).ready(function(){
$ = unsafeWindow.$;
$.ajax({
url: discogsWsUrl,
dataType: 'jsonp',
headers: { 'Accept-Encoding': 'gzip', 'User-Agent': 'MBDiscosgImporter/0.1 +http://userscripts.org/scripts/show/36376' },
crossDomain: true,
success: function (data, textStatus, jqXHR) {
url: discogsWsUrl,
dataType: 'jsonp',
headers: { 'Accept-Encoding': 'gzip', 'User-Agent': 'MBDiscosgImporter/0.1 +http://userscripts.org/scripts/show/36376' },
crossDomain: true,
success: function (data, textStatus, jqXHR) {
//mylog(data);
var release = parseDiscogsRelease(data);
insertLink(release);
},
error: function(jqXHR, textStatus, errorThrown) {
},
error: function(jqXHR, textStatus, errorThrown) {
mylog("AJAX Status:" + textStatus);
mylog("AJAX error thrown:" + errorThrown);
}
}
});
// Back to GreaseMonkey's JQuery

View file

@ -21,44 +21,44 @@
--- 'release' object format : ---
release = {
title,
artist_credit = [ { name: '',
type,
status,
language,
script,
packaging,
country,
year,
month,
day,
labels = [ { name, mbid, catno }, ... ],
barcode,
discs = [
{
title,
format,
position,
tracks = [
{ number, title, duration, artist_credit },
...
]
},
...
],
}
title,
artist_credit = [ { name: '',
type,
status,
language,
script,
packaging,
country,
year,
month,
day,
labels = [ { name, mbid, catno }, ... ],
barcode,
discs = [
{
title,
format,
position,
tracks = [
{ number, title, duration, artist_credit },
...
]
},
...
],
}
where 'artist_credit' has the following format:
artist_credit = [
{
credited_name,
artist_name,
artist_mbid,
joinphrase
},
...
]
{
credited_name,
artist_name,
artist_mbid,
joinphrase
},
...
]
*/
@ -129,7 +129,7 @@ var MBReleaseImportHelper = (function() {
if (!isNaN(release.day) && release.day != 0) { appendParameter(parameters, 'date.day', release.day); };
// Barcode
appendParameter(parameters, 'barcode', release.barcode);
appendParameter(parameters, 'barcode', release.barcode);
// Label + catnos
for (var i=0; i < release.labels.length; i++) {