|
|
@@ -36,29 +36,25 @@ const _arrangeByMaterial = artistsList => {
|
|
36
|
36
|
|
|
37
|
37
|
let seen = 0
|
|
38
|
38
|
const _arrangeByAlpha = artistsList => {
|
|
39
|
|
- const alphabet = [...'abcdefghijklmnopqrstuvwxyz']
|
|
|
39
|
+ const alphabet = [...'9abcdefghijklmnopqrstuvwxyz']
|
|
40
|
40
|
const flatPacked = []
|
|
41
|
41
|
artistsList.forEach((artist, i) => {
|
|
42
|
42
|
const lastWord = artist.slug.split('-').filter(c => c).pop()
|
|
43
|
43
|
const firstCharaOfLastWord = lastWord[0]
|
|
44
|
44
|
const firstCharaOfSortWord = artist.sortname ? artist.sortname[0] : 'z'
|
|
45
|
|
-
|
|
46
|
|
- console.log(firstCharaOfLastWord, firstCharaOfSortWord)
|
|
47
|
|
-
|
|
48
|
45
|
const charaIndex = alphabet.indexOf(firstCharaOfLastWord) < alphabet.indexOf(firstCharaOfSortWord) ? alphabet.indexOf(firstCharaOfLastWord) : alphabet.indexOf(firstCharaOfSortWord)
|
|
49
|
46
|
|
|
50
|
|
- console.log(charaIndex)
|
|
|
47
|
+ console.log('chara loading:', charaIndex)
|
|
51
|
48
|
// The first artist you've seen in this batch
|
|
52
|
49
|
if(i == 0) {
|
|
53
|
50
|
seen = charaIndex
|
|
54
|
|
- console.log(alphabet[seen], seen)
|
|
55
|
51
|
flatPacked.push({ slug: alphabet[seen], title: alphabet[seen], inbetween: true })
|
|
56
|
52
|
}
|
|
57
|
53
|
|
|
58
|
54
|
if (charaIndex == seen + 1) {
|
|
59
|
55
|
seen++
|
|
60
|
56
|
if(seen > alphabet.length) { seen = 0 }
|
|
61
|
|
-
|
|
|
57
|
+
|
|
62
|
58
|
flatPacked.push({ slug: alphabet[seen], title: alphabet[seen], inbetween: true })
|
|
63
|
59
|
}
|
|
64
|
60
|
flatPacked.push(artist)
|