Thank you for your donation!


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


Moode 9, new webui's tag view album list and album is blank
#11
Looks like the "encodedAt" tag was empty or not present for at least one Album in the library tag cache. This would be a possible bug in the server-side getEncodedAt() function in inc/music-library.php since it should always return something.

To find out which album causes the JS crash place the console.log line below in /var/www/js/scripts-library.js right after the "for" statement on line 622.

for (var i = 0; i < filteredAlbums.length; i++) {
        console.log(filteredAlbums[i]);
        filteredAlbums[i].year ? tagViewYear = '(' + filteredAlbums[i].year.toString().slice(0, 4) + ')' : tagViewYear = '';

Then repro the issue, find the last entry in the JS log which should be the one causing the crash and click it to display all the items for that album. Post the list or a screenshot.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#12
There doesn't actually seem to be a /var/www/js/scripts-library.js file, looked on both Moode 8 and 9.
Reply
#13
My bad the js files are bundled and minified which makes local editing impossible. Lets see what can be done to log things in the server-side code.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#14
How many files are we talking about?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#15
   

not sure if the log is useful, last entry doesn't have channel count listed, but its DSD and stereo and plays fine.

Paul
Reply
#16
Here's what the section thats crashing in scripts-library.js does for a normally formatted encodedAt item which in this case is the var "tim".

Code:
tim = "FLAC 24/96,h,2";
'FLAC 24/96,h,2'

tom = tim.split(',');
(3) ['FLAC 24/96', 'h', '2']

bob = tom[0].split(' ')[1]; // This is the line that causes the crash by returning 'undefined'
'24/96'

If my analysis is correct then it looks like the server-side code is not able to determine either the format, rate or both for a particular file for example "24/96,h,2" or "FLAC,h,2" or ",h,2". These will all cause the JS line to crash.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#17
(06-01-2024, 02:09 PM)vinnn Wrote: There doesn't actually seem to be a /var/www/js/scripts-library.js file, looked on both Moode 8 and 9.

(06-01-2024, 02:45 PM)grumbleweed Wrote: not sure if the log is useful, last entry doesn't have channel count listed, but its DSD and stereo and plays fine.

Paul

Yes, that will also crash the JS line

Code:
tim = "DSD,h";
'DSD,h'
tom = tim.split(',');
(2) ['DSD', 'h']
bob = tom[0].split(' ')[1];
undefined
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#18
Should be easy to fix, prolly in the server-side code. I'll do some testing.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#19
good news, Thanks Tim
Reply
#20
It turns out the bugs were in the front-end JS scripts. See the following commit.
https://github.com/moode-player/moode/co...efb2e23101
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: