Skip to content

Commit

Permalink
hide map
Browse files Browse the repository at this point in the history
  • Loading branch information
simon300000 committed Sep 2, 2023
1 parent f48d6e0 commit c3386f9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
30 changes: 27 additions & 3 deletions api/spider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,16 @@ const refreshMusicList = async () => {
Korean: '"계획대로" 보완 계획'
},
musicList: []
},
HideMap: {
displayName: {
ChineseS: "有里谱",
ChineseT: "有里譜",
English: "With Hidden Sheet",
Japanese: "裏譜面あり",
Korean: "히든 채보"
},
musicList: []
}
}

Expand All @@ -301,7 +311,6 @@ const refreshMusicList = async () => {
await checkNewSong(uid)
}


const newList: Record<string, string[]> = {}
for (const { uid } of musicList) {
if (await isNewSong(uid)) {
Expand All @@ -318,12 +327,13 @@ const refreshMusicList = async () => {

const { music_tag_list: rawTag } = await downloadTag().catch(e => {
log(e)
return { music_tag_list: [] }
return { music_tag_list: [] } as MusicTagList
})
if (!rawTag.length) {
return
}
const collab = rawTag.filter(({ tag_name: { English } }) => English === 'Collab').flatMap(({ music_list }) => music_list)

const { music_list: collab } = rawTag.find(({ tag_name: { English } }) => English === 'Collab')
const collabMusicList: Record<string, string[]> = {}
collab.forEach(id => {
const [albumNum] = id.split('-')
Expand All @@ -336,6 +346,20 @@ const refreshMusicList = async () => {

tags.X.musicList = Object.entries(collabMusicList).map(([json, ids]) => ({ json, musics: ids }))

const hideMapList: Record<string, string[]> = {}
for (const { json, music } of albumList) {
for (const { uid, difficulty } of music) {
if (difficulty[3] !== '0' || difficulty[4] !== '0') {
if (!hideMapList[json]) {
hideMapList[json] = []
}
hideMapList[json].push(uid)
}
}
}

tags.HideMap.musicList = Object.entries(hideMapList).map(([json, ids]) => ({ json, musics: ids }))

const tagExport = Object.entries(tags).map(([n, v]) => ({ name: n, ...v }))
await putTag(tagExport)
}
Expand Down
Binary file added src/icons/IconHideMap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default {
Cute: 'IconCuteIsEveryting.png',
GiveUp: 'IconGiveUpTreatment.png',
X: 'X.png',
HideMap: 'IconHideMap.png',
New: 'IconNew.png',
PlannedPlus: 'IconJustAsPlanned.png'
}
Expand Down

0 comments on commit c3386f9

Please sign in to comment.