diff --git a/package.json b/package.json index 73f8bc1..6f4bca7 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "SSPM Simply Plays Music", "main": "src/main.js", + "type": "module", "scripts": { "start": "electron .", "test": "echo \"Error: no test specified\" && exit 1" @@ -13,6 +14,7 @@ "electron": "^33.0.1" }, "dependencies": { - "@electron/remote": "^2.1.2" + "id3js": "^2.1.1", + "mp3-duration": "^1.1.0" } } diff --git a/src/id3-parse.js b/src/id3-parse.js new file mode 100644 index 0000000..292e1f0 --- /dev/null +++ b/src/id3-parse.js @@ -0,0 +1,16 @@ +const id3 = require('id3js'); +const ipcMain = require('ipc-main'); + +ipcMain.on('getAudioInfo', function(event, file) { + let id3tags; + + id3.fromFile(file).then(function(tags) { + id3tags = tags; + }).catch(function(reason) { + console.log(reason); + }) + + return id3tags; +}); + + diff --git a/src/index.html b/src/index.html index c5f6731..922cc50 100644 --- a/src/index.html +++ b/src/index.html @@ -1,21 +1,22 @@ -
- - - - -👋
- - - \ No newline at end of file + + + + + +