浏览代码

:bug: tweaking flatpacking for by episode

tags/0.9.0
J 4 年前
父节点
当前提交
f00de65f37
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2
    3
      vue-theme/src/store/modules/artist.js

+ 2
- 3
vue-theme/src/store/modules/artist.js 查看文件

63
     const byEpisode = {}
63
     const byEpisode = {}
64
     artistsList.forEach(artist => {
64
     artistsList.forEach(artist => {
65
         const relatedEpisode = artist.related_episode
65
         const relatedEpisode = artist.related_episode
66
-        if(!Object.keys(byEpisode).includes(relatedEpisode)) {
67
-            byEpisode[relatedEpisode] = []
68
-        }
66
+        if(!byEpisode[relatedEpisode]) byEpisode[relatedEpisode] = []
69
         byEpisode[relatedEpisode].push(artist)
67
         byEpisode[relatedEpisode].push(artist)
70
     })
68
     })
71
     const flatPacked = []
69
     const flatPacked = []
73
         flatPacked.push({ slug: byEpisode, title: byEpisode, inbetween: true })
71
         flatPacked.push({ slug: byEpisode, title: byEpisode, inbetween: true })
74
         byEpisode[episode].forEach(artist => flatPacked.push(artist))
72
         byEpisode[episode].forEach(artist => flatPacked.push(artist))
75
     })
73
     })
74
+    console.log('flatPacked :', flatPacked)
76
     return flatPacked
75
     return flatPacked
77
 }
76
 }
78
 
77
 

正在加载...
取消
保存