Просмотр исходного кода

:bug: accounting for sortname

tags/0.9.0
J 4 лет назад
Родитель
Сommit
87c2496bc1
1 измененных файлов: 4 добавлений и 3 удалений
  1. 4
    3
      vue-theme/src/store/modules/artist.js

+ 4
- 3
vue-theme/src/store/modules/artist.js Просмотреть файл

@@ -41,15 +41,16 @@ const _arrangeByAlpha = artistsList => {
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[0]
45
+        const charaIndex = alphabet.indexOf(firstCharaOfLastWord) < alphabet.indexOf(firstCharaOfSortWord) ? alphabet.indexOf(firstCharaOfLastWord) : alphabet.indexOf(firstCharaOfSortWord)
45 46
         // The first artist you've seen in this batch
46 47
         if(i == 0) {
47
-            seen = alphabet.indexOf(firstCharaOfLastWord)
48
+            seen = charaIndex
48 49
             console.log(alphabet[seen], seen)
49 50
             flatPacked.push({ slug: alphabet[seen], title: alphabet[seen], inbetween: true })
50 51
         }
51 52
 
52
-        if (alphabet.indexOf(firstCharaOfLastWord) == seen + 1) {
53
+        if (charaIndex == seen + 1) {
53 54
             seen++
54 55
             flatPacked.push({ slug: alphabet[seen], title: alphabet[seen], inbetween: true })
55 56
         }

Загрузка…
Отмена
Сохранить