Music Path is an environment variable

This commit is contained in:
Rekai Musuka 2019-05-21 00:53:30 -05:00
parent 26f4a7d88b
commit 03c0af9151
7 changed files with 33 additions and 7 deletions

3
.env.example Normal file
View File

@ -0,0 +1,3 @@
NODE_ENV=development
PORT=8080
MUSIC_PATH=

View File

@ -25,6 +25,7 @@
"babel-loader": "^8.0.4",
"chai": "^4.2.0",
"css-loader": "^2.1.0",
"dotenv-webpack": "^1.7.0",
"electron": "^5.0.1",
"file-loader": "^3.0.1",
"mocha": "^6.0.0",

View File

@ -16,10 +16,7 @@ import Archive from "./melodii/SongArchive";
var archive = new Archive();
var mp = new MusicPlayer();
// const playlist = new Playlist("Test", "\\\\PAODA-SERVER\\Weeb_Home\\Music")
// archive.add(null, playlist);
const filepath = new Filepath("/home/paoda/Downloads/Music");
const filepath = new Filepath(process.env.MUSIC_PATH);
(async () => {
let list = await filepath.getValidFiles();

View File

@ -71,7 +71,7 @@ export default class Body extends React.Component {
};
if (!Settings.has("tableJSON")) {
let tableJSON = await generate("/home/paoda/Downloads/Music", template);
let tableJSON = await generate(process.env.MUSIC_PATH, template);
console.log("Initialize: ", tableJSON)
this.setState({ table: tableJSON });

View File

@ -61,7 +61,7 @@ export default class SettingsManager extends Modal {
if (Settings.has("tableJSON")) Settings.set("tableJSON", template);
else console.info("There was no Table Saved to Delete!")
const tableJSON = await generate("/home/paoda/Downloads/Music", template);
const tableJSON = await generate(process.env.MUSIC_PATH, template);
Emitter.emit("newTable", tableJSON);

View File

@ -1,4 +1,7 @@
require('dotenv').config();
const Dotenv = require('dotenv-webpack');
const path = require('path');
const webpack = require('webpack');
@ -37,5 +40,8 @@ module.exports = {
contentBase: path.join(__dirname, 'build'),
compress: true,
port: process.env.PORT
}
},
plugins: [
new Dotenv()
]
};

View File

@ -2062,6 +2062,25 @@ domain-browser@^1.1.1:
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==
dotenv-defaults@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/dotenv-defaults/-/dotenv-defaults-1.0.2.tgz#441cf5f067653fca4bbdce9dd3b803f6f84c585d"
integrity sha512-iXFvHtXl/hZPiFj++1hBg4lbKwGM+t/GlvELDnRtOFdjXyWP7mubkVr+eZGWG62kdsbulXAef6v/j6kiWc/xGA==
dependencies:
dotenv "^6.2.0"
dotenv-webpack@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-1.7.0.tgz#4384d8c57ee6f405c296278c14a9f9167856d3a1"
integrity sha512-wwNtOBW/6gLQSkb8p43y0Wts970A3xtNiG/mpwj9MLUhtPCQG6i+/DSXXoNN7fbPCU/vQ7JjwGmgOeGZSSZnsw==
dependencies:
dotenv-defaults "^1.0.2"
dotenv@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064"
integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==
dotenv@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.0.0.tgz#ed310c165b4e8a97bb745b0a9d99c31bda566440"