mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-14 04:12:28 +00:00
discogs: make vinyl release number calculation even simpler
Use basic binary to get rid of uppercase/lowercase issue.
This commit is contained in:
parent
3bb072da97
commit
bb83f406d6
1 changed files with 2 additions and 6 deletions
|
@ -663,12 +663,8 @@ function parseDiscogsRelease(data) {
|
|||
}
|
||||
} else {
|
||||
if (trackPosition.match(/^[A-Z]\d*$/i)) { // Vinyl or cassette, handle it specially
|
||||
var code = trackPosition.toUpperCase().charCodeAt(0);
|
||||
// A-Z
|
||||
if (65 <= code && code <= 90) {
|
||||
code = code - 65;
|
||||
}
|
||||
releaseNumber = (code-code%2)/2+1;
|
||||
// A,B -> 1; C,D -> 2; E,F -> 3, etc...
|
||||
releaseNumber = ((32|trackPosition.charCodeAt(0))-97>>1)+1;
|
||||
lastPosition++;
|
||||
} else if (trackPosition.match(/^[A-Z]+\d*$/i)) { // Vinyl or cassette, handle it specially
|
||||
// something like AA1, exemple : http://www.discogs.com/release/73531
|
||||
|
|
Loading…
Reference in a new issue