Skip to content

Commit

Permalink
fix: check if beetsDB file exists before unlink
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasghodsian authored Aug 4, 2024
1 parent d491021 commit 40fa587
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src-backend/controllers/metaController.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ export const writeMetaToFile = (req, res) => {
checkFileExists(filePath, fileName, res);

// Remove beets db file to avoid issues
fs.unlink(beetsDB);

if (fs.existsSync(beetsDB)) {
fs.unlink(beetsDB);
}

const beetsArgs = [
'import',
'--write',
Expand Down

0 comments on commit 40fa587

Please sign in to comment.