Thank you for your donation!


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


Solved: Thumbnails are missing
#1
Thumbnail regeneration fails...

Running 8.2.5


Code:
20230206 201143 worker: Mount monitor (Off)
20230206 201143 worker: Watchdog started
20230206 201143 worker: Ready
20230206 201147 genLibraryUTF8Rep(): Error: file create failed: /var/local/www/libcache


ls -l /var/local/www/


Code:
-rwxrwxrwx 1 root root 780946 Feb  6 20:11 libcache_all.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_folder.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_format.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_hdonly.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_lossless.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_lossy.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_tag.json


Checked recently added albums, and if played the album art is displayed OK.
Reply
#2
(02-06-2023, 08:49 PM)steve4star Wrote: Thumbnail regeneration fails...

Running 8.2.5


Code:
20230206 201143 worker: Mount monitor (Off)
20230206 201143 worker: Watchdog started
20230206 201143 worker: Ready
20230206 201147 genLibraryUTF8Rep(): Error: file create failed: /var/local/www/libcache


ls -l /var/local/www/


Code:
-rwxrwxrwx 1 root root 780946 Feb  6 20:11 libcache_all.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_folder.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_format.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_hdonly.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_lossless.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_lossy.json
-rwxrwxrwx 1 root root      0 Feb  6 20:11 libcache_tag.json


Checked recently added albums, and if played the album art is displayed OK.

As far as I can tell that's not the thumbnail generation, but the library itself, that gets sent to the UI. And everything looks ok (0-byte files for not-yet-applied library filters are expected behavior).

Thumbnails, OTOH, get (re)generated by the relevant command in the LIBRARY configuration tab, or automatically (the missing new ones) upon a library update under the "m" menu.
Such thumbnails are stored in the /var/local/www/imagesw/thmcache folder. They have weird names (the hash of the folder the relevant music file is in...) but that's the way the UI expects them to work.

Now, since we're here also to try to help, can you tell us what is that makes you assert the thumb-generation fails?
Reply
#3
(02-06-2023, 09:23 PM)Nutul Wrote: As far as I can tell that's not the thumbnail generation, but the library itself, that gets sent to the UI. And everything looks ok (0-byte files for not-yet-applied library filters are expected behavior).

Thumbnails, OTOH, get (re)generated by the relevant command in the LIBRARY configuration tab, or automatically (the missing new ones) upon a library update under the "m" menu.
Such thumbnails are stored in the /var/local/www/imagesw/thmcache folder. They have weird names (the hash of the folder the relevant music file is in...) but that's the way the UI expects them to work.

Now, since we're here also to try to help, can you tell us what is that makes you assert the thumb-generation fails?

The thumbnails do not appear, and the status is stuck on generating if I try to force a refresh from the menu.

Forgot to add that the folder is empty..

Code:
pi@moode:~ $ ls -ltr /var/local/www/imagesw/thmcache
total 0


Attached Files Thumbnail(s)
   
Reply
#4
@steve4star 

I'll reserve judgment about the thumbnails for a moment.

Looking at your first post I see


Code:
20230206 201147 genLibraryUTF8Rep(): Error: file create failed: /var/local/www/libcache


A quick scan of the moOde codebase shows that error message gets generated in /var/www/inc/music-library.php

I'll leave this one for @Tim Curtis since I'm wackadoodle with php code. As I read the code-segment involved, I think the genLibraryUTF8Rep() function would be invoked only if the m>Preferences-->Advanced-->UTF8 character filter option is enabled but I failed to generate the error in a quick test.

Regards,
Kent
Reply
#5
@steve4star It looks like you have the Prefs option "UTF8 character filter" enabled. What happens when you turn it off?

The log entry below indicates some sort of problem creating the library cache file. Another oddness is that the file path in the error message is incomplete. It should be something like "/var/local/www/libcache_all.json"

Code:
20230206 201147 genLibraryUTF8Rep(): Error: file create failed: /var/local/www/libcache

The dev that created the UTF8 filter function several years ago is no longer contributing to moOde so I've listed the function below if anyone has some insights into what it's actually doing.

Code:
// UTF8 replace (@lazybat)
function utf8rep($str) {
    // Reject overly long 2 byte sequences, as well as characters above U+10000 and replace with ? (@lazybat)
    $str = preg_replace('/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]'.
        '|[\x00-\x7F][\x80-\xBF]+'.
        '|([\xC0\xC1]|[\xF0-\xFF])[\x80-\xBF]*'.
        '|[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})'.
        '|[\xE0-\xEF](([\x80-\xBF](?![\x80-\xBF]))|(?![\x80-\xBF]{2})|[\x80-\xBF]{3,})/S',
        '--', $str);

    // Reject overly long 3 byte sequences and UTF-16 surrogates and replace with ?
    $str = preg_replace('/\xE0[\x80-\x9F][\x80-\xBF]'.
        '|\xED[\xA0-\xBF][\x80-\xBF]/S','--', $str);

    return $str;
}
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
(02-06-2023, 10:17 PM)TheOldPresbyope Wrote: @steve4star 

I'll reserve judgment about the thumbnails for a moment.

Looking at your first post I see


Code:
20230206 201147 genLibraryUTF8Rep(): Error: file create failed: /var/local/www/libcache


A quick scan of the moOde codebase shows that error message gets generated in /var/www/inc/music-library.php

I'll leave this one for @Tim Curtis since I'm wackadoodle with php code. As I read the code-segment involved, I think the genLibraryUTF8Rep() function would be invoked only if the m>Preferences-->Advanced-->UTF8 character filter option is enabled but I failed to generate the error in a quick test.

Regards,
Kent
UTF-8 option is set to No, but have toggled to Yes and still have empty thumb cache.

I will re-install at the weekend and try and reproduce, rather than waste too much of everyone's time.
Reply
#7
I have re-imaged my SD card and installed a fresh 8.2.5.
Restored my backup, updated library and all was good.

I added a few more albums via rsync and submitted a library updated via curl, and the new thumbs were added OK.

Closing this, will open if it reoccurs.

Thanks for all the help/suggestions.
Reply


Forum Jump: