feat(aklive2d): init music process
This commit is contained in:
@@ -1,19 +1,35 @@
|
||||
/* eslint-disable no-undef */
|
||||
import path from 'path';
|
||||
import { read } from './yaml.js';
|
||||
import Downloader from "./downloader.js"
|
||||
|
||||
export default class Music {
|
||||
#downloader = new Downloader()
|
||||
#sharedPath = path.join(__projectRoot, __config.folder.operator, __config.folder.share)
|
||||
|
||||
async process() {
|
||||
|
||||
}
|
||||
|
||||
async #download() {
|
||||
const metaTable = await this.#downloader.github(`https://api.github.com/repos/Kengxxiao/ArknightsGameData/commits?path=zh_CN/gamedata/excel/display_meta_table.json`, `https://raw.githubusercontent.com/Kengxxiao/ArknightsGameData/master/zh_CN/gamedata/excel/display_meta_table.json`, path.join(this.#sharedPath, `display_meta_table.json`))
|
||||
const audioDataTable = await this.#downloader.github(`https://api.github.com/repos/Kengxxiao/ArknightsGameData/commits?path=zh_CN/gamedata/excel/audio_data.json`, `https://raw.githubusercontent.com/Kengxxiao/ArknightsGameData/master/zh_CN/gamedata/excel/audio_data.json`, path.join(this.#sharedPath, `audio_data.json`))
|
||||
console.log(metaTable, audioDataTable)
|
||||
}
|
||||
|
||||
copy() {
|
||||
const musicFolder = path.join(__projectRoot, __config.folder.operator, __config.folder.share, __config.folder.music);
|
||||
const musicMapping = read(path.join(musicFolder, 'mapping.yaml'));
|
||||
const musicToCopy = Object.values(musicMapping).map(entry => Object.values(entry)).flat(1).filter(entry => entry !== null).map(entry => {
|
||||
return {
|
||||
filename: entry,
|
||||
source: musicFolder,
|
||||
}
|
||||
})
|
||||
|
||||
export default function () {
|
||||
const musicFolder = path.join(__projectRoot, __config.folder.operator, __config.folder.share, __config.folder.music);
|
||||
const musicMapping = read(path.join(musicFolder, 'mapping.yaml'));
|
||||
const musicToCopy = Object.values(musicMapping).map(entry => Object.values(entry)).flat(1).filter(entry => entry !== null).map(entry => {
|
||||
return {
|
||||
filename: entry,
|
||||
source: musicFolder,
|
||||
musicToCopy,
|
||||
musicMapping,
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
musicToCopy,
|
||||
musicMapping,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user