Browse Source

:recycle: logging chara index

tags/0.9.0
J 4 years ago
parent
commit
b4eba916a1
1 changed files with 3 additions and 7 deletions
  1. 3
    7
      vue-theme/src/store/modules/artist.js

+ 3
- 7
vue-theme/src/store/modules/artist.js View File

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

Loading…
Cancel
Save