Skip to content

Commit

Permalink
fix: null match result
Browse files Browse the repository at this point in the history
  • Loading branch information
LynMoe authored Feb 16, 2021
1 parent 954eaa3 commit dfdc7c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ if (!fs.existsSync(path.resolve(__root, '.azusa/'))) {
const oldTrackIds = JSON.parse(fs.readFileSync(filePath).toString())

const playlistData = fs.readFileSync(playlistPath).toString()
const modifiedTrackIds = playlistData.match(/\/(\d+)\./g).map(v => parseInt(v.replace('/', '').replace('.', ''), 10))
const modifiedTrackIds = playlistData.match(/[\/\\](\d+)\./g).map(v => parseInt(v.match(/(\d+)/)[0], 10))

const idDiff = fad.diff(oldTrackIds, modifiedTrackIds)
await Promise.all([...(new Set(idDiff.added))].map(id => {
Expand Down

0 comments on commit dfdc7c4

Please sign in to comment.