From 8d8dd3dfe6ff10f66c14e808e07a4b6bb125df29 Mon Sep 17 00:00:00 2001 From: Paoda Date: Wed, 20 Feb 2019 14:21:43 -0600 Subject: [PATCH] moved createID to MiscMethods.js began work on playlist management. --- src/App.js | 4 ++-- src/components/Body.js | 6 ++++-- src/components/Body/Table.js | 31 +++---------------------------- src/components/MiscMethods.js | 25 +++++++++++++++++++++++++ src/melodii/MusicPlayer.js | 25 +++++++++++++++++++++++-- src/melodii/Playlist.js | 26 +++++++++++++++++++++++++- 6 files changed, 82 insertions(+), 35 deletions(-) diff --git a/src/App.js b/src/App.js index 727758a..3fd7571 100644 --- a/src/App.js +++ b/src/App.js @@ -28,14 +28,14 @@ const filepath = new Filepath("C:\\Users\\Paoda\\Downloads"); song = await Song.getMetadata(song); Song.setAlbumArt(song.metadata); - mp.load(song); + mp.loadSong(song); // mp.play(); mp.element.onended = async () => { let song = new Song(list[~~(Math.random() * list.length)]); song = await Song.getMetadata(song); Song.setAlbumArt(song.metadata); - mp.load(song); + mp.loadSong(song); mp.play(); }; })(); diff --git a/src/components/Body.js b/src/components/Body.js index e0d5893..577e352 100644 --- a/src/components/Body.js +++ b/src/components/Body.js @@ -29,12 +29,14 @@ export default class Body extends React.Component { this.initialize(); } shouldComponentUpdate(nextProps, state) { - if (this.state.table.id) return this.state.table.id !== state.table.id; + if (this.state.table) return this.state.table.id !== state.table.id; + else return false; // On Feb 13 2019 Had problem wehre this.state.table.id was undefined. // Unable to replicate issue, but it's a serous one. Probably should fix this yeah? } render() { - console.log("Render TableID: " + this.state.table.id); + if (this.state.table) console.log("Render TableID: " + this.state.table.id); + else console.warn("No Table Present"); return (