* fix: nextFMTrack 执行顺序

* fix: 当前歌曲无法播放时,播放下一首

* fix: windows下无法创建部分文件

* fix: windows下无法加载sqlite3
This commit is contained in:
memorydream 2022-04-08 14:02:50 +08:00 committed by GitHub
parent 530581ba82
commit 24798a0bf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View file

@ -1,4 +1,5 @@
import fs from 'fs'
import path from 'path'
export const createDirIfNotExist = (dir: string) => {
if (!fs.existsSync(dir)) {
@ -7,7 +8,7 @@ export const createDirIfNotExist = (dir: string) => {
}
export const createFileIfNotExist = (file: string) => {
createDirIfNotExist(file.split('/').slice(0, -1).join('/'))
createDirIfNotExist(path.dirname(file))
if (!fs.existsSync(file)) {
fs.writeFileSync(file, '')
}