diff --git a/src/api/scrobbler.js b/src/api/scrobbler.js index 951f868..2c82953 100644 --- a/src/api/scrobbler.js +++ b/src/api/scrobbler.js @@ -19,8 +19,8 @@ exports.setup = (mstream) => { mstream.post('/api/v1/lastfm/scrobble-by-metadata', (req, res) => { const schema = Joi.object({ - artist: Joi.string().required(), - album: Joi.string().required(), + artist: Joi.string().optional(), + album: Joi.string().optional(), track: Joi.string().required(), }); joiValidate(schema, req.body); diff --git a/webapp/alpha/m.js b/webapp/alpha/m.js index 30c6244..824ac5e 100644 --- a/webapp/alpha/m.js +++ b/webapp/alpha/m.js @@ -1516,7 +1516,7 @@ function setupLayoutPanel() {
@@ -1532,7 +1532,7 @@ function setupLayoutPanel() {
-->
@@ -1567,6 +1567,14 @@ function setupLayoutPanel() { document.getElementById('filelist').innerHTML = newHtml; } +function tglMoveMetadata() { + VUEPLAYERCORE.altLayout.moveMeta = !VUEPLAYERCORE.altLayout.moveMeta; +} + +function tglBookCtrls() { + VUEPLAYERCORE.altLayout.audioBookCtrls = !VUEPLAYERCORE.altLayout.audioBookCtrls; +} + function flipPlayer() { document.getElementById('content').style.flexDirection = 'column-reverse' } diff --git a/webapp/alpha/spa.css b/webapp/alpha/spa.css index ec89866..47ffac1 100644 --- a/webapp/alpha/spa.css +++ b/webapp/alpha/spa.css @@ -664,7 +664,7 @@ body { .header-tab{ z-index: 1000; - display: flow-root; + display: flex; } .grow { @@ -921,6 +921,27 @@ svg { select { background-color: #2d333b !important; -color: #FFF; -cursor: pointer; + color: #FFF; + cursor: pointer; +} + +.custom-card-img img { + max-height: 140px; +} + +.card-mod { + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +.card-mod .card-content { + padding: 6px !important; +} + +.card-meta { + padding-left: 12px; +} + +.flex-end { + justify-content: flex-end; } \ No newline at end of file diff --git a/webapp/alpha/vp.js b/webapp/alpha/vp.js index 88d283a..d8d4b98 100644 --- a/webapp/alpha/vp.js +++ b/webapp/alpha/vp.js @@ -1,6 +1,11 @@ const VUEPLAYERCORE = (() => { const mstreamModule = {}; + mstreamModule.altLayout = { + 'moveMeta': false, + 'audioBookCtrls': false + }; + const replayGainPreGainSettings = [ -15.0, -10.0, @@ -42,9 +47,30 @@ const VUEPLAYERCORE = (() => { data: { playlist: MSTREAMPLAYER.playlist, playlists: mstreamModule.playlists, - showClear: showClearLink + showClear: showClearLink, + altLayout: mstreamModule.altLayout, + meta: MSTREAMPLAYER.playerStats.metadata + }, + computed: { + albumArtPath: function () { + if (!this.meta['album-art']) { + return 'assets/img/default.png'; + } + return MSTREAMAPI.currentServer.host + `album-art/${this.meta['album-art']}?token=${MSTREAMPLAYER.getCurrentSong().authToken}`; + } }, methods: { + goToArtist: function() { + const el = document.createElement('DIV'); + el.setAttribute('data-artist', this.meta.artist); + getArtistz(el); + }, + goToAlbum: function() { + const el = document.createElement('DIV'); + el.setAttribute('data-album', this.meta.album); + el.setAttribute('data-year', this.meta.year); + getAlbumsOnClick(el); + }, checkMove: function (event) { document.getElementById("pop").style.visibility = "hidden"; MSTREAMPLAYER.resetPositionCache(); @@ -256,6 +282,7 @@ const VUEPLAYERCORE = (() => { meta: MSTREAMPLAYER.playerStats.metadata, lastVol: 100, replayGainToggle: false, + altLayout: mstreamModule.altLayout }, created: function () { if (typeof(Storage) !== "undefined") { @@ -270,6 +297,10 @@ const VUEPLAYERCORE = (() => { } }, computed: { + playbackRate: function() { + const rate = Number(this.playerStats.playbackRate); + return rate.toFixed(2) + 'x' + }, currentTime: function() { if (!this.playerStats.duration) { return ''; } @@ -350,6 +381,12 @@ const VUEPLAYERCORE = (() => { el.setAttribute('data-year', this.meta.year); getAlbumsOnClick(el); }, + goForward: function(seconds) { + MSTREAMPLAYER.goForwardSeek(seconds); + }, + goBack: function(seconds) { + MSTREAMPLAYER.goBackSeek(seconds); + }, fadeOverlay: function () { VIZ.toggleDom(); }, diff --git a/webapp/index.html b/webapp/index.html index b744f9c..f531df5 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -249,10 +249,10 @@ Jukebox
- +
Navigation
@@ -284,7 +284,7 @@
-
+
@@ -306,7 +306,7 @@
-
+

Title: @@ -331,11 +331,23 @@

-
+
DJ - +
+
+ +
+ 30 +
+
+ {{playbackRate}} +
+ +
+ 30 +
@@ -394,10 +406,10 @@
-
+
Now Playing
-
+
@@ -412,6 +424,28 @@
+
+
+
+ +
+
+

+ Title: + {{ (meta.title) ? meta.title : '' }} +

+

+ Artist: + {{ (meta.artist) ? meta.artist : '' }} +

+

+ Album: + {{ (meta.album) ? meta.album : '' }} +

+

Year: {{ (meta.year) ? meta.year : '' }}

+
+
+