mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 15:31:51 +08:00
importsongs no longer has a static category list
This commit is contained in:
parent
41ddbb66a9
commit
387d1268fd
@ -38,25 +38,18 @@
|
|||||||
"oni": 3,
|
"oni": 3,
|
||||||
"ura": 4
|
"ura": 4
|
||||||
}
|
}
|
||||||
this.categories = {
|
|
||||||
"ボーカロイド曲": "ボーカロイド™曲",
|
this.categoryAliases = {}
|
||||||
"ボーカロイド": "ボーカロイド™曲",
|
|
||||||
"vocaloid music": "ボーカロイド™曲",
|
assets.categories.forEach(cat => {
|
||||||
"vocaloid": "ボーカロイド™曲",
|
this.categoryAliases[cat.title.toLowerCase()] = cat.title.toLowerCase()
|
||||||
"バラエティー": "バラエティ",
|
if(cat.aliases != null){
|
||||||
"どうよう": "バラエティ",
|
cat.aliases.forEach(alias => {
|
||||||
"童謡・民謡": "バラエティ",
|
this.categoryAliases[alias.toLowerCase()] = cat.title.toLowerCase()
|
||||||
"children": "バラエティ",
|
});
|
||||||
"children/folk": "バラエティ",
|
|
||||||
"children-folk": "バラエティ",
|
|
||||||
"クラッシック": "クラシック",
|
|
||||||
"classic": "クラシック"
|
|
||||||
}
|
|
||||||
for(var i in allStrings){
|
|
||||||
for(var ja in allStrings[i].categories){
|
|
||||||
this.categories[allStrings[i].categories[ja].toLowerCase()] = ja
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
this.assetSelectors = {
|
this.assetSelectors = {
|
||||||
"bg-pattern-1": ".pattern-bg",
|
"bg-pattern-1": ".pattern-bg",
|
||||||
"bg_genre_0": "#song-select",
|
"bg_genre_0": "#song-select",
|
||||||
@ -137,7 +130,7 @@
|
|||||||
var equalsPos = line.indexOf("=")
|
var equalsPos = line.indexOf("=")
|
||||||
if(equalsPos !== -1 && line.slice(0, equalsPos).trim() === "genrename"){
|
if(equalsPos !== -1 && line.slice(0, equalsPos).trim() === "genrename"){
|
||||||
var value = line.slice(equalsPos + 1).trim()
|
var value = line.slice(equalsPos + 1).trim()
|
||||||
category = this.categories[value] || data[i].trim().slice(equalsPos + 1).trim()
|
category = this.categoryAliases[value] || data[i].trim().slice(equalsPos + 1).trim()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,12 +140,12 @@
|
|||||||
var line = data[i].trim().toLowerCase()
|
var line = data[i].trim().toLowerCase()
|
||||||
if(line.startsWith("#title:")){
|
if(line.startsWith("#title:")){
|
||||||
var value = line.slice(7).trim()
|
var value = line.slice(7).trim()
|
||||||
if(value in this.categories){
|
if(value in this.categoryAliases){
|
||||||
category = this.categories[value]
|
category = this.categoryAliases[value]
|
||||||
}
|
}
|
||||||
}else if(line.startsWith("#genre:")){
|
}else if(line.startsWith("#genre:")){
|
||||||
var value = line.slice(7).trim()
|
var value = line.slice(7).trim()
|
||||||
category = this.categories[value] || data[i].trim().slice(7).trim()
|
category = this.categoryAliases[value] || data[i].trim().slice(7).trim()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -215,7 +208,6 @@
|
|||||||
var subtitleLang = {}
|
var subtitleLang = {}
|
||||||
var dir = file.webkitRelativePath.toLowerCase()
|
var dir = file.webkitRelativePath.toLowerCase()
|
||||||
dir = dir.slice(0, dir.lastIndexOf("/") + 1)
|
dir = dir.slice(0, dir.lastIndexOf("/") + 1)
|
||||||
var hasCategory = false
|
|
||||||
for(var diff in tja.metadata){
|
for(var diff in tja.metadata){
|
||||||
var meta = tja.metadata[diff]
|
var meta = tja.metadata[diff]
|
||||||
songObj.title = meta.title || file.name.slice(0, file.name.lastIndexOf("."))
|
songObj.title = meta.title || file.name.slice(0, file.name.lastIndexOf("."))
|
||||||
@ -234,7 +226,7 @@
|
|||||||
songObj.music = this.otherFiles[dir + meta.wave.toLowerCase()] || songObj.music
|
songObj.music = this.otherFiles[dir + meta.wave.toLowerCase()] || songObj.music
|
||||||
}
|
}
|
||||||
if(meta.genre){
|
if(meta.genre){
|
||||||
songObj.category = this.categories[meta.genre.toLowerCase()] || meta.genre
|
songObj.category = this.categoryAliases[meta.genre.toLowerCase()] || meta.genre
|
||||||
}
|
}
|
||||||
if(meta.taikowebskin){
|
if(meta.taikowebskin){
|
||||||
songObj.song_skin = this.getSkin(dir, meta.taikowebskin)
|
songObj.song_skin = this.getSkin(dir, meta.taikowebskin)
|
||||||
@ -445,9 +437,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!hasTitle){
|
if(!hasTitle){
|
||||||
for(var cat in this.categories){
|
for(var cat in this.categoryAliases){
|
||||||
if(path[i].indexOf(cat) !== -1){
|
if(path[i].indexOf(cat) !== -1){
|
||||||
return this.categories[cat]
|
return this.categoryAliases[cat]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user