diff --git a/webapp/alpha/m.js b/webapp/alpha/m.js index b23295f..70e0f15 100644 --- a/webapp/alpha/m.js +++ b/webapp/alpha/m.js @@ -47,7 +47,7 @@ function renderFileWithMetadataHtml(filepath, lokiId, metadata) {
- + remove
@@ -66,7 +66,7 @@ function createMusicFileHtml(fileLocation, title, aa, rating, subtitle) {
- + @@ -82,11 +82,11 @@ function renderDirHtml(name) { ${name}
- - + + - +
` @@ -320,9 +320,12 @@ async function init() { } catch (e) {} try { - if(localStorage.getItem('transcode') === 'true') { + if(localStorage.getItem('transcode') === 'true' && MSTREAMPLAYER.transcodeOptions.serverEnabled === true) { toggleTranscoding(undefined, true); } + MSTREAMPLAYER.transcodeOptions.selectedCodec = localStorage.getItem('trans-codec-select'); + MSTREAMPLAYER.transcodeOptions.selectedBitrate = localStorage.getItem('trans-bitrate-select'); + MSTREAMPLAYER.transcodeOptions.selectedAlgo = localStorage.getItem('trans-algo-select'); } catch (e) {} // try { @@ -1010,19 +1013,19 @@ function setupTranscodePanel(el){ function changeTranscodeBitrate() { const value = document.getElementById("trans-bitrate-select").value; MSTREAMPLAYER.transcodeOptions.selectedBitrate = value ? value : null; - console.log(MSTREAMPLAYER.transcodeOptions) + value ? localStorage.setItem('trans-bitrate-select', value) : localStorage.removeItem('trans-bitrate-select'); } function changeTranscodeCodec() { - const codec = document.getElementById("trans-codec-select").value; - MSTREAMPLAYER.transcodeOptions.selectedCodec = codec ? codec : null; - console.log(MSTREAMPLAYER.transcodeOptions) + const value = document.getElementById("trans-codec-select").value; + MSTREAMPLAYER.transcodeOptions.selectedCodec = value ? value : null; + value ? localStorage.setItem('trans-codec-select', value) : localStorage.removeItem('trans-codec-select'); } function changeTranscodeAlgo() { const value = document.getElementById("trans-algo-select").value; MSTREAMPLAYER.transcodeOptions.selectedAlgo = value ? value : null; - console.log(MSTREAMPLAYER.transcodeOptions) + value ? localStorage.setItem('trans-algo-select', value) : localStorage.removeItem('trans-algo-select'); } function toggleTranscoding(el, manual){ @@ -1048,7 +1051,7 @@ function toggleTranscoding(el, manual){ if (el) { el.disabled = false; } } -///////////////////////////// Mobile Stuff +///////////////////////////// Mobile Stuff function getMobilePanel(el){ setBrowserRootPanel(el, 'Mobile Apps'); document.getElementById('directory_bar').style.display = 'none'; @@ -1101,12 +1104,15 @@ function autoDjPanel(el) { if (!MSTREAMPLAYER.ignoreVPaths[MSTREAMAPI.currentServer.vpaths[i]]) { checkedString = 'checked'; } - newHtml += ` -
`; + newHtml += ` +
`; } - newHtml += '

Minimum Rating

'; for (let i = 0; i < 11; i++) { newHtml += ``; } @@ -1116,5 +1122,77 @@ function autoDjPanel(el) { document.getElementById('filelist').innerHTML = newHtml; } +function onAutoDJFolderChange(el) { + // Don't allow user to deselect all options + if (document.querySelector('input[name=autodj-folders]:checked') === null) { + el.checked = true; + iziToast.warning({ + title: 'Auto DJ requires a directory', + position: 'topCenter', + timeout: 3500 + }); + return; + } + + if (el.checked) { + MSTREAMPLAYER.ignoreVPaths[el.value] = false; + } else { + MSTREAMPLAYER.ignoreVPaths[el.value] = true; + } + + localStorage.setItem('ignoreVPaths', JSON.stringify(MSTREAMPLAYER.ignoreVPaths)); +} + +function updateAutoDJRatings(el) { + MSTREAMPLAYER.minRating = el.value; + localStorage.setItem('minRating', JSON.stringify([MSTREAMPLAYER.minRating])); +} + +////////////// Jukebox +function setupJukeboxPanel(el) { + setBrowserRootPanel(el, 'Jukebox Mode'); + document.getElementById('directory_bar').style.display = 'none'; + + let newHtml; + if (JUKEBOX.stats.live !== false && JUKEBOX.connection !== false) { + newHtml = createJukeboxPanel(); + } else { + newHtml = ` +

+

+

Jukebox Mode allows you to control this page remotely

+

+ +

`; + } + + // Add the content + document.getElementById('filelist').innerHTML = newHtml; +} + +function createJukeboxPanel() { + if (JUKEBOX.stats.error !== false) { + return '
An error occurred. Please refresh the page and try again
'; + } + + const address = `${window.location.protocol}//${window.location.host}/remote/${JUKEBOX.stats.adminCode}`; + return `
+

Code: ${JUKEBOX.stats.adminCode}

+

${address}

+ ${qrcodegen.QrCode.encodeText(address, qrcodegen.QrCode.Ecc.MEDIUM).toSvgString(2)} +

`; +} + +function connectToJukeBox(el) { + el.disabled = true; + el.style.display = 'none'; + + document.getElementById('filelist').innerHTML += getLoadingSvg(); + + JUKEBOX.createWebsocket(MSTREAMAPI.currentServer.token, false, () => { + setupJukeboxPanel(); + }); +} + loadFileExplorer(); init(); \ No newline at end of file diff --git a/webapp/alpha/spa.css b/webapp/alpha/spa.css index 3ecec89..8e696a2 100644 --- a/webapp/alpha/spa.css +++ b/webapp/alpha/spa.css @@ -445,16 +445,16 @@ body { .button-block { margin-top: 8px; - width: 222px; display: flex; - + margin-right: 10px; } .button-block-1 { margin-top: 8px; width: 180px; display: flex; - + margin-left: 10px; + justify-content: right; } .volume { @@ -540,6 +540,7 @@ body { .songDropdown { min-width: 38px !important; + line-height: 100% !important; } #pop-d, #pop-f { @@ -622,9 +623,9 @@ body { } .deletePlaylist, .removePlaylistSong { + line-height: 100% !important; padding-left: 7px; padding-right: 7px; - padding-top: 1px; border-bottom-left-radius: 3px; } @@ -769,4 +770,13 @@ svg { .browser-panel { margin: 12px; +} + +.collection .collection-item { + line-height: normal !important; +} + +.flex-center { + display: flex; + justify-content: center; } \ No newline at end of file diff --git a/webapp/assets/js/mstream.jukebox.js b/webapp/assets/js/mstream.jukebox.js index 5cf015b..8887af3 100644 --- a/webapp/assets/js/mstream.jukebox.js +++ b/webapp/assets/js/mstream.jukebox.js @@ -105,7 +105,7 @@ var JUKEBOX = (function () { return; } if( json.command === 'addSong' && json.file){ - MSTREAMAPI.addSongWizard(json.file, {}, true); + VUEPLAYERCORE.addSongWizard(json.file, {}, true); } }; } diff --git a/webapp/index.html b/webapp/index.html index ec09c36..d0f5b42 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -57,6 +57,9 @@ + + + @@ -192,11 +195,11 @@ Albums
- + Artists
- + Recent
@@ -301,25 +304,29 @@
-
- - - DJ - - -
-
-
-
{{playerStats.replayGainPreGainDb}}db
- RG -
- - - - - -
-
+
+
+ + + DJ + +
+
+ +
+
+
+
{{playerStats.replayGainPreGainDb}}db
+ RG +
+ + + + + +
+
+
diff --git a/webapp/index.js b/webapp/index.js index 8709585..fcc8731 100644 --- a/webapp/index.js +++ b/webapp/index.js @@ -10,7 +10,7 @@ function createWindow () { } }) - win.loadFile('./alpha/index.html') + win.loadFile('./index.html') } app.whenReady().then(() => {