transfer all remaining assets to webapp folder

This commit is contained in:
IrosTheBeggar 2021-02-02 18:33:25 -05:00
parent 9fc05ee95a
commit b0cfd005b3
20 changed files with 23 additions and 25 deletions

View File

@ -1,7 +1,6 @@
const winston = require('winston');
const express = require('express');
const fs = require('fs');
const path = require('path');
const bodyParser = require('body-parser');
const jukebox = require('./modules/jukebox.js');
@ -56,7 +55,6 @@ exports.serveIt = async configFile => {
});
// Give access to public folder
mstream.use('/public', express.static(path.join(__dirname, 'public')));
mstream.use('/', express.static(config.program.webAppDirectory));
// JukeBox

View File

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 136 KiB

View File

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 494 B

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 222 B

View File

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 324 B

View File

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 443 B

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 588 B

After

Width:  |  Height:  |  Size: 588 B

View File

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 416 B

View File

@ -34,7 +34,7 @@ function createFileplaylistHtml(dataDirectory) {
}
function createMusicfileHtml(fileLocation, title, titleClass) {
return '<div data-file_location="' + fileLocation + '" class="filez"><img class="music-image" src="/public/img/music-note.svg"> <span class="' + titleClass + '">' + title + '</span></div>';
return '<div data-file_location="' + fileLocation + '" class="filez"><img class="music-image" src="/assets/img/music-note.svg"> <span class="' + titleClass + '">' + title + '</span></div>';
}
$(document).ready(function () {
@ -562,7 +562,7 @@ $(document).ready(function () {
filelist +=
`<div class="clear relative">
<div data-directory="${dir.name}" class="dirz">
<img class="folder-image" src="/public/img/folder.svg">
<img class="folder-image" src="/assets/img/folder.svg">
<span class="item-text">${dir.name}</span>
</div>
<div class="song-button-box">
@ -631,7 +631,7 @@ $(document).ready(function () {
if (lowerCase.indexOf(searchVal.toLowerCase()) !== -1) {
if (this.type === 'directory') {
filelist.push('<div class="clear relative"><div data-directory="' + this.name + '" class="dirz"><img class="folder-image" src="/public/img/folder.svg"><span class="item-text">' + this.name + '</span></div><div data-directory="' + this.name + '" class="song-button-box"><span title="Add All To Queue" class="recursiveAddDir" data-directory="' + this.name + '"><svg xmlns="http://www.w3.org/2000/svg" height="9" width="9" viewBox="0 0 1280 1276"><path d="M6760 12747 c-80 -5 -440 -10 -800 -11 -701 -2 -734 -4 -943 -57 -330 -84 -569 -281 -681 -563 -103 -256 -131 -705 -92 -1466 12 -241 16 -531 16 -1232 l0 -917 -1587 -4 c-1561 -3 -1590 -3 -1703 -24 -342 -62 -530 -149 -692 -322 -158 -167 -235 -377 -244 -666 -43 -1404 -42 -1813 7 -2355 21 -235 91 -400 233 -548 275 -287 730 -389 1591 -353 1225 51 2103 53 2330 7 l60 -12 6 -1489 c6 -1559 6 -1548 49 -1780 100 -535 405 -835 933 -921 88 -14 252 -17 1162 -24 591 -4 1099 -4 1148 1 159 16 312 56 422 112 118 59 259 181 333 290 118 170 195 415 227 722 18 173 21 593 6 860 -26 444 -32 678 -34 1432 l-2 811 54 7 c30 4 781 6 1670 5 1448 -2 1625 -1 1703 14 151 28 294 87 403 168 214 159 335 367 385 666 15 85 29 393 30 627 0 105 4 242 10 305 43 533 49 1047 15 1338 -44 386 -144 644 -325 835 -131 140 -278 220 -493 270 -92 21 -98 21 -1772 24 l-1680 3 3 1608 c2 1148 0 1635 -8 1706 -49 424 -255 701 -625 841 -243 91 -633 124 -1115 92z" transform="matrix(.1 0 0 -.1 0 1276)"/></svg></span><span class="downloadDir"><svg width="12" height="12" viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg"><path d="M1803 960q0 53-37 90l-651 652q-39 37-91 37-53 0-90-37l-651-652q-38-36-38-90 0-53 38-91l74-75q39-37 91-37 53 0 90 37l294 294v-704q0-52 38-90t90-38h128q52 0 90 38t38 90v704l294-294q37-37 90-37 52 0 91 37l75 75q37 39 37 91z"/></svg></span></div></div>');
filelist.push('<div class="clear relative"><div data-directory="' + this.name + '" class="dirz"><img class="folder-image" src="/assets/img/folder.svg"><span class="item-text">' + this.name + '</span></div><div data-directory="' + this.name + '" class="song-button-box"><span title="Add All To Queue" class="recursiveAddDir" data-directory="' + this.name + '"><svg xmlns="http://www.w3.org/2000/svg" height="9" width="9" viewBox="0 0 1280 1276"><path d="M6760 12747 c-80 -5 -440 -10 -800 -11 -701 -2 -734 -4 -943 -57 -330 -84 -569 -281 -681 -563 -103 -256 -131 -705 -92 -1466 12 -241 16 -531 16 -1232 l0 -917 -1587 -4 c-1561 -3 -1590 -3 -1703 -24 -342 -62 -530 -149 -692 -322 -158 -167 -235 -377 -244 -666 -43 -1404 -42 -1813 7 -2355 21 -235 91 -400 233 -548 275 -287 730 -389 1591 -353 1225 51 2103 53 2330 7 l60 -12 6 -1489 c6 -1559 6 -1548 49 -1780 100 -535 405 -835 933 -921 88 -14 252 -17 1162 -24 591 -4 1099 -4 1148 1 159 16 312 56 422 112 118 59 259 181 333 290 118 170 195 415 227 722 18 173 21 593 6 860 -26 444 -32 678 -34 1432 l-2 811 54 7 c30 4 781 6 1670 5 1448 -2 1625 -1 1703 14 151 28 294 87 403 168 214 159 335 367 385 666 15 85 29 393 30 627 0 105 4 242 10 305 43 533 49 1047 15 1338 -44 386 -144 644 -325 835 -131 140 -278 220 -493 270 -92 21 -98 21 -1772 24 l-1680 3 3 1608 c2 1148 0 1635 -8 1706 -49 424 -255 701 -625 841 -243 91 -633 124 -1115 92z" transform="matrix(.1 0 0 -.1 0 1276)"/></svg></span><span class="downloadDir"><svg width="12" height="12" viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg"><path d="M1803 960q0 53-37 90l-651 652q-39 37-91 37-53 0-90-37l-651-652q-38-36-38-90 0-53 38-91l74-75q39-37 91-37 53 0 90 37l294 294v-704q0-52 38-90t90-38h128q52 0 90 38t38 90v704l294-294q37-37 90-37 52 0 91 37l75 75q37 39 37 91z"/></svg></span></div></div>');
} else if (this.type === 'playlist') {
filelist.push('<div data-playlistname="' + encodeURIComponent(this.name) + '" class="playlist_row_container"><span data-playlistname="' + encodeURIComponent(this.name) + '" class="playlistz force-width">' + escapeHtml(this.name) + '</span><div class="song-button-box"><span data-playlistname="' + encodeURIComponent(this.name) + '" class="deletePlaylist">Delete</span></div></div>');
} else if (this.type === 'album') {
@ -641,18 +641,18 @@ $(document).ready(function () {
if (this.album_art_file) {
filelist.push('<div ' + artistString + ' data-album="' + this.name + '" class="albumz"><img class="album-art-box" data-original="/album-art/' + this.album_art_file + '?token=' + MSTREAMAPI.currentServer.token + '"><span class="explorer-label-1">' + albumString + '</span></div>');
} else {
filelist.push('<div ' + artistString + ' data-album="' + this.name + '" class="albumz"><img class="album-art-box" src="/public/img/default.png"><span class="explorer-label-1">' + albumString + '</span></div>');
filelist.push('<div ' + artistString + ' data-album="' + this.name + '" class="albumz"><img class="album-art-box" src="/assets/img/default.png"><span class="explorer-label-1">' + albumString + '</span></div>');
}
} else if (this.type === 'artist') {
filelist.push('<div data-artist="' + this.name + '" class="artistz">' + this.name + ' </div>');
} else {
if (programState[programState.length - 1].state === 'playlist') {
if (!this.metadata || !this.metadata.title) {
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="album-art-box" src="/public/img/default.png"><span class="explorer-label-1">' + this.filepath + '</span></div>');
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="album-art-box" src="/assets/img/default.png"><span class="explorer-label-1">' + this.filepath + '</span></div>');
} else if (this.metadata['album-art']) {
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="album-art-box" data-original="/album-art/' + this.metadata['album-art'] + '?token=' + MSTREAMAPI.currentServer.token + '"><span class="explorer-label-1">' + this.metadata.artist + ' - ' + this.metadata.title + '</span></div>');
} else {
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="album-art-box" src="/public/img/default.png"><span class="explorer-label-1">' + this.metadata.artist + ' - ' + this.metadata.title + '</span></div>');
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="album-art-box" src="/assets/img/default.png"><span class="explorer-label-1">' + this.metadata.artist + ' - ' + this.metadata.title + '</span></div>');
}
} else if (this.type == "m3u") {
filelist.push(createFileplaylistHtml(this.name));
@ -962,13 +962,13 @@ $(document).ready(function () {
$.each(response, function (index, value) {
if (!value.metadata || !value.metadata.title) {
currentBrowsingList.push({ type: 'file', name: value.filepath, metadata: value.metadata });
files.push('<div data-lokiid="'+value.lokiId+'" class="clear relative"><div data-lokiid="'+value.lokiId+'" data-file_location="' + value.filepath + '" class="filez left"><img class="album-art-box" src="/public/img/default.png"><span class="explorer-label-1">' + value.filepath + '</span></div><div class="song-button-box"><span data-lokiid="'+value.lokiId+'" class="removePlaylistSong">remove</span></div></div>');
files.push('<div data-lokiid="'+value.lokiId+'" class="clear relative"><div data-lokiid="'+value.lokiId+'" data-file_location="' + value.filepath + '" class="filez left"><img class="album-art-box" src="/assets/img/default.png"><span class="explorer-label-1">' + value.filepath + '</span></div><div class="song-button-box"><span data-lokiid="'+value.lokiId+'" class="removePlaylistSong">remove</span></div></div>');
} else if (value.metadata['album-art']) {
currentBrowsingList.push({ type: 'file', name: value.metadata.artist + ' - ' + value.metadata.title, metadata: value.metadata });
files.push('<div data-lokiid="'+value.lokiId+'" class="clear relative"><div data-lokiid="'+value.lokiId+'" data-file_location="' + value.filepath + '" class="filez left"><img class="album-art-box" data-original="/album-art/' + value.metadata['album-art'] + '?token=' + MSTREAMAPI.currentServer.token + '"><span class="explorer-label-1">' + value.metadata.artist + ' - ' + value.metadata.title + '</span></div><div class="song-button-box"><span data-lokiid="'+value.lokiId+'" class="removePlaylistSong">remove</span></div></div>');
} else {
currentBrowsingList.push({ type: 'file', name: value.metadata.artist + ' - ' + value.metadata.title, metadata: value.metadata });
files.push('<div data-lokiid="'+value.lokiId+'" class="clear relative"><div data-lokiid="'+value.lokiId+'" data-file_location="' + value.filepath + '" class="filez left"><img class="album-art-box" src="/public/img/default.png"><span class="explorer-label-1">' + value.metadata.artist + ' - ' + value.metadata.title + '</span></div><div class="song-button-box"><span data-lokiid="'+value.lokiId+'" class="removePlaylistSong">remove</span></div></div>');
files.push('<div data-lokiid="'+value.lokiId+'" class="clear relative"><div data-lokiid="'+value.lokiId+'" data-file_location="' + value.filepath + '" class="filez left"><img class="album-art-box" src="/assets/img/default.png"><span class="explorer-label-1">' + value.metadata.artist + ' - ' + value.metadata.title + '</span></div><div class="song-button-box"><span data-lokiid="'+value.lokiId+'" class="removePlaylistSong">remove</span></div></div>');
}
});
@ -1071,10 +1071,10 @@ $(document).ready(function () {
$.each(response, function () {
if (this.metadata.title) {
currentBrowsingList.push({ type: 'file', name: this.metadata.artist + ' - ' + this.metadata.title })
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="music-image" src="/public/img/music-note.svg"> <span class="title">' + this.metadata.artist + ' - ' + this.metadata.title + '</span></div>');
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="music-image" src="/assets/img/music-note.svg"> <span class="title">' + this.metadata.artist + ' - ' + this.metadata.title + '</span></div>');
} else {
currentBrowsingList.push({ type: 'file', name: this.metadata.filename })
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="music-image" src="/public/img/music-note.svg"> <span class="title">' + this.metadata.filename + '</span></div>');
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="music-image" src="/assets/img/music-note.svg"> <span class="title">' + this.metadata.filename + '</span></div>');
}
});
@ -1114,7 +1114,7 @@ $(document).ready(function () {
albums.push('<div data-album="' + value.name + '" class="albumz"><img class="album-art-box" data-original="/album-art/' + value.album_art_file + '?token=' + MSTREAMAPI.currentServer.token + '"><span class="explorer-label-1">' + value.name + '</span></div>');
} else {
currentBrowsingList.push({ type: 'album', name: value.name });
albums.push('<div data-album="' + value.name + '" class="albumz"><img class="album-art-box" src="/public/img/default.png"><span class="explorer-label-1">' + value.name + '</span></div>');
albums.push('<div data-album="' + value.name + '" class="albumz"><img class="album-art-box" src="/assets/img/default.png"><span class="explorer-label-1">' + value.name + '</span></div>');
}
});
@ -1166,10 +1166,10 @@ $(document).ready(function () {
$.each(response, function () {
if (this.metadata.title) {
currentBrowsingList.push({ type: 'file', name: this.metadata.title })
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="music-image" src="/public/img/music-note.svg"> <span class="title">' + this.metadata.title + '</span></div>');
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="music-image" src="/assets/img/music-note.svg"> <span class="title">' + this.metadata.title + '</span></div>');
} else {
currentBrowsingList.push({ type: 'file', name: this.metadata.filename })
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="music-image" src="/public/img/music-note.svg"> <span class="title">' + this.metadata.filename + '</span></div>');
filelist.push('<div data-file_location="' + this.filepath + '" class="filez"><img class="music-image" src="/assets/img/music-note.svg"> <span class="title">' + this.metadata.filename + '</span></div>');
}
});
@ -1248,7 +1248,7 @@ $(document).ready(function () {
if (value.album_art_file) {
albums.push('<div data-artist="' + artist + '" data-album="' + value.name + '" class="albumz"><img class="album-art-box" data-original="/album-art/' + value.album_art_file + '?token=' + MSTREAMAPI.currentServer.token + '"><span class="explorer-label-1">' + albumString + '</span></div>');
} else {
albums.push('<div data-artist="' + artist + '" data-album="' + value.name + '" class="albumz"><img class="album-art-box" src="/public/img/default.png"><span class="explorer-label-1">' + albumString + '</span></div>');
albums.push('<div data-artist="' + artist + '" data-album="' + value.name + '" class="albumz"><img class="album-art-box" src="/assets/img/default.png"><span class="explorer-label-1">' + albumString + '</span></div>');
}
currentBrowsingList.push({ type: 'album', name: value.name, artist: artist, album_art_file: value.album_art_file })
});
@ -1300,13 +1300,13 @@ $(document).ready(function () {
if (!value.metadata || !value.metadata.title) {
currentBrowsingList.push({ type: 'file', name: value.filepath, metadata: value.metadata });
files.push('<div data-file_location="' + value.filepath + '" class="filez"><img class="album-art-box" src="/public/img/default.png"><span class="explorer-label-1">[' + rating + '] ' + value.filepath + ']</span></div>');
files.push('<div data-file_location="' + value.filepath + '" class="filez"><img class="album-art-box" src="/assets/img/default.png"><span class="explorer-label-1">[' + rating + '] ' + value.filepath + ']</span></div>');
} else if (value.metadata['album-art']) {
currentBrowsingList.push({ type: 'file', name: value.metadata.artist + ' - ' + value.metadata.title, metadata: value.metadata });
files.push('<div data-file_location="' + value.filepath + '" class="filez"><img class="album-art-box" data-original="/album-art/' + value.metadata['album-art'] + '?token=' + MSTREAMAPI.currentServer.token + '"><span class="explorer-label-1">[' + rating + '] ' + value.metadata.artist + ' - ' + value.metadata.title + '</span></div>');
} else {
currentBrowsingList.push({ type: 'file', name: value.metadata.artist + ' - ' + value.metadata.title, metadata: value.metadata });
files.push('<div data-file_location="' + value.filepath + '" class="filez"><img class="album-art-box" src="/public/img/default.png"><span class="explorer-label-1">[' + rating + '] ' + value.metadata.artist + ' - ' + value.metadata.title + '</span></div>');
files.push('<div data-file_location="' + value.filepath + '" class="filez"><img class="album-art-box" src="/assets/img/default.png"><span class="explorer-label-1">[' + rating + '] ' + value.metadata.artist + ' - ' + value.metadata.title + '</span></div>');
}
});
@ -1724,7 +1724,7 @@ $(document).ready(function () {
<h3>Jukebox Mode allows you to control this page remotely<h3> <br><br>\
<input value="Connect" type="button" class="jukebox_connect">\
</p>\
<img src="/public/img/loading.gif" class="hide jukebox-loading">';
<img src="/assets/img/loading.gif" class="hide jukebox-loading">';
}
// Add the content

View File

@ -63,11 +63,11 @@ var VUEPLAYER = (function () {
Vue.component('playlist-item', {
template: '\
<div class="noselect playlist-item" v-bind:class="{ playing: (this.index === positionCache.val), playError: (this.songError && this.songError === true) }" >\
<span class="drag-handle"><img src="/public/img/drag-handle.svg"></span><span v-on:click="goToSong($event)" class="song-area">{{ comtext }}</span>\
<span class="drag-handle"><img src="/assets/img/drag-handle.svg"></span><span v-on:click="goToSong($event)" class="song-area">{{ comtext }}</span>\
<div class="song-button-box">\
<span v-on:click="removeSong($event)" class="removeSong">X</span>\
<span v-on:click="createPopper($event)" class="songDropdown pop-c">\
{{ratingNumber}}<img class="star-small pop-c" src="/public/img/star.svg">\
{{ratingNumber}}<img class="star-small pop-c" src="/assets/img/star.svg">\
</span>\
<span class="downloadPlaylistSong" v-on:click="downloadSong($event)">\
<svg width="12" height="12" viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg"><path d="M1803 960q0 53-37 90l-651 652q-39 37-91 37-53 0-90-37l-651-652q-38-36-38-90 0-53 38-91l74-75q39-37 91-37 53 0 90 37l294 294v-704q0-52 38-90t90-38h128q52 0 90 38t38 90v704l294-294q37-37 90-37 52 0 91 37l75 75q37 39 37 91z"/></svg>\
@ -244,10 +244,10 @@ var VUEPLAYER = (function () {
},
computed: {
imgsrc: function () {
return "/public/img/" + (this.playerStats.playing ? 'pause' : 'play') + "-white.svg";
return "/assets/img/" + (this.playerStats.playing ? 'pause' : 'play') + "-white.svg";
},
volumeSrc: function () {
return "/public/img/" + (this.playerStats.volume !== 0 ? 'volume' : 'volume-mute') + ".svg";
return "/assets/img/" + (this.playerStats.volume !== 0 ? 'volume' : 'volume-mute') + ".svg";
},
widthcss: function () {
if (this.playerStats.duration === 0) {
@ -381,7 +381,7 @@ var VUEPLAYER = (function () {
computed: {
albumArtPath: function () {
if (!this.meta['album-art']) {
return '/public/img/default.png';
return '/assets/img/default.png';
}
return '/album-art/' + this.meta['album-art'] + '?token=' + MSTREAMAPI.currentServer.token;
}

View File

@ -22,7 +22,7 @@ const VUEPLAYERCORE = (() => {
},
albumArtPath: function () {
if (!this.meta['album-art']) {
return '/public/img/default.png';
return '/assets/img/default.png';
}
return `/album-art/${this.meta['album-art']}?token=${MSTREAMPLAYER.getCurrentSong().authToken}`;
}