Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: (Tiny) layout issue
#1
    As mentioned in the subject, a tiny issue...
I have a compilation album (Global Sounds 3) where the name of one the artists contains a super script 2 or power of 2:
   
As you can see this messes up the layout.
To confirm it is not a typo, the info from Discogs:
   

==== Update ====
The issue is *not* the 2, but maybe in the track name of the previous item.
That track name is <BPM>
If that track is playing the layout is wrong:
   
When that track is gone the layout is correct:
   

The track name is not visible in the list, but is correctly displayed on the right hand side:
   
Reply
#2
Well, strictly speaking, this is a trio with two artists named Morelenbaum and one named Sakamoto. The superscript 2 appears in the overly clever name of the trio.

I imagine Tim will need to know what the actual track metadata are to get a handle on how to protect the UI layout.

ETA - I just caught your comment about the track title including "<" and ">" characters. Interesting.

Regards,
Kent
Reply
#3
I assume the <BPM> in the track name is being treated as the start of a HTML tag.
Not sure how the title is presented to the UI, but it would require escaping special HTML characters.
Reply
#4
(11-22-2024, 07:00 PM)PJVervoorn Wrote: As mentioned in the subject, a tiny issue...
I have a compilation album (Global Sounds 3) where the name of one the artists contains a super script 2 or power of 2:

As you can see this messes up the layout.
To confirm it is not a typo, the info from Discogs:


==== Update ====
The issue is *not* the 2, but maybe in the track name of the previous item.
That track name is <BPM>
If that track is playing the layout is wrong:

When that track is gone the layout is correct:


The track name is not visible in the list, but is correctly displayed on the right hand side:

I have some tracks in one of my test collection with <> in the title and no issues.

To troubleshoot try the following.

1. Right click on the Queue item and "Inspect" the element in the Browser console. Post a screen shot of the HTML.
2. Bring up Audio info for the track(s) and post some screen shots showing all the metadata.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
I can repro the issue. Created a fake album with three FLAC tracks.

Using mediainfo, the first track is


Code:
General
Complete name                            : CEOTTK1.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 71.1 KiB
Duration                                 : 5 s 0 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 116 kb/s
Album                                    : Fake it til ya make it
Album/Performer                          : FFMPEG
Track name                               : My Track 1
Track name/Position                      : 01
Performer                                : TheOldPresbyope
Genre                                    : Test
Recorded date                            : 2024
...


The second is


Code:
General
Complete name                            : CEOTTK2.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 71.1 KiB
Duration                                 : 5 s 0 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 116 kb/s
Album                                    : Fake it til ya make it
Album/Performer                          : FFMPEG
Track name                               : <My Track 2>
Track name/Position                      : 02
Performer                                : TheOldPresbyope
Genre                                    : Test
Recorded date                            : 2024
...

The third is
Code:
General
Complete name                            : CEOTTK3.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 71.1 KiB
Duration                                 : 5 s 0 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 116 kb/s
Album                                    : Fake it til ya make it
Album/Performer                          : FFMPEG
Track name                               : My Track 3
Track name/Position                      : 03
Performer                                : TheOldPresbyope
Genre                                    : Test
Recorded date                            : 2024
...

And track 3 is indented in the queue.

I'll post the HTML in a bit.

Regards,
Kent
Reply
#6
(11-22-2024, 09:46 PM)TheOldPresbyope Wrote: I can repro the issue. Created a fake album with three FLAC tracks.

Using mediainfo, the first track is


Code:
General
Complete name                            : CEOTTK1.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 71.1 KiB
Duration                                 : 5 s 0 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 116 kb/s
Album                                    : Fake it til ya make it
Album/Performer                          : FFMPEG
Track name                               : My Track 1
Track name/Position                      : 01
Performer                                : TheOldPresbyope
Genre                                    : Test
Recorded date                            : 2024
...


The second is


Code:
General
Complete name                            : CEOTTK2.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 71.1 KiB
Duration                                 : 5 s 0 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 116 kb/s
Album                                    : Fake it til ya make it
Album/Performer                          : FFMPEG
Track name                               : <My Track 2>
Track name/Position                      : 02
Performer                                : TheOldPresbyope
Genre                                    : Test
Recorded date                            : 2024
...

The third is
Code:
General
Complete name                            : CEOTTK3.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 71.1 KiB
Duration                                 : 5 s 0 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 116 kb/s
Album                                    : Fake it til ya make it
Album/Performer                          : FFMPEG
Track name                               : My Track 3
Track name/Position                      : 03
Performer                                : TheOldPresbyope
Genre                                    : Test
Recorded date                            : 2024
...

And track 3 is indented in the queue.

I'll post the HTML in a bit.

Regards,
Kent

Nice. 

PM me a download link for the flac that reproduces the issue and I'll test on my end.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
Thanks for the replies.
I can confirm the <BPM> is the cause of this strange effect, but it is the artist, not the track name.
   

Screencap with code:
   

I have a link with the track, let me see if I can forward it to you..
Reply
#8
@PJVervoorn I just got your download and can repro the issue, same as @TheOldPresbyope.

I'll investigate in a bit but it does appear that the angle brackets in "<BPM>" are not unescaped as @steve4star suggested and are being treated as an HTML tag.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#9
Fixed.

All sample files from @PJVervoorn and @TheOldPresbyope looking good.

Add the bolded line below to function getPlayqueue() in file /var/www/command/queue.php. No need to reboot.

// Return MPD queue

function getPlayqueue($resp) {
    if (is_null($resp)) {
        debugLog('getPlayqueue(): Returned null');
        return null;
    } else {
        $queue = array();
        $line = strtok($resp,"\n");
        $idx = -1;

        while ($line) {
            list ($element, $value) = explode(': ', $line, 2);

            $value = htmlspecialchars($value, ENT_NOQUOTES);

            if ($element == 'file') {
            $idx++;
.

.
.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#10
Works here.

Regards,
Kent
Reply


Forum Jump: