IrosTheBeggar / mStream

The easiest music streaming server available
http://mstream.io
GNU General Public License v3.0
2.21k stars 186 forks source link

error when trying to click the "File path" URL that is given when looking at song info #410

Open ctracy opened 1 year ago

ctracy commented 1 year ago

In webapp/alpha/m.js, function openMetadataModal(), there is a section which prepares the URL to be displayed as the "File path" here:

Screenshot 2023-05-14 at 3 25 42 PM

In my instance, I have found that there is a missing forward slash near line 559. I had to modify the code like this in order to be able to click on album art when displaying the song info in order to not get an error. See my diff below:

diff --git a/webapp/alpha/m.js b/webapp/alpha/m.js
index e5005de..686d92e 100644
--- a/webapp/alpha/m.js
+++ b/webapp/alpha/m.js
@@ -556,7 +556,10 @@ function openMetadataModal(metadata, fp) {
   document.getElementById('meta--rating').innerHTML = metadata.rating;
   document.getElementById('meta--rg').innerHTML = metadata['replaygain-track'];
   document.getElementById('meta--fp').innerHTML = fp;
-  document.getElementById('meta--fp').href = 'media' + fp;
+  // this should really be 'media/' otherwise you get an error when trying to click the URL
+  // this is displayed when you click the album art when playing a song or go to the song info
+  document.getElementById('meta--fp').href = 'media/' + fp;
   document.getElementById('meta--aa').innerHTML = 'album-art/' + metadata['album-art'];
   if (metadata['album-art']) {
     document.getElementById('meta--aa').href = `album-art/${metadata['album-art']}`;