06-21-2024, 07:28 PM
Hi,
sry for late reply, was busy...
Ah, I see, there's no "central" configuration for this items. That makes things worse.
Let me share my findings so far.
The reason for having bootfs & rootfs in the list: don't know. they are part of /media. I didn't put them in there, they are automagically there. My setup: Raspi3B+, moode flashed to SSD (on usb) and on th sdCard there's bootcode.bin for succefsul boots. that's not an ideal setup. my Pi4 is coming in like a month. On Pi 3 it might be better to bot from SD card...
But let me recap what I found so far.
- MPD uses /var/lib/mpd/music to find it's music
- thumb-gen uses:
aka /mnt and /media to LOG what it is searching for.
in /media it adds a /USB in front of all entries.
if entries are in /mnt and /media, they are duplicated.
but that's just a log based on thumb-gen.php. the real scanning for folders is then forwarded to list-songfiles.sh which again takes (hardcoded) /mnt and /media for finding posible libraries.
And I think here's a bug. But, please doublecheck :
The original list-songfiles.sh used
to identify the songfiles on /mnt. this didn't deliver any results on my setup. However, adding a trailing '/' to this find delivers a working list of files/dictionaries and thus a wonderfully created thumbnail.
so, my new / "fixed" code looks like this:
The difference between thos two versions is (on my example playground):
Bonus fact: None of this methods uses
from constants.php. So... there's a lot of hardcoded folder/file knowledge that doesn't account to any settings/constants/mpd settings. maybe worth fixing this.
Kind regards,
Martin
sry for late reply, was busy...
Ah, I see, there's no "central" configuration for this items. That makes things worse.
Let me share my findings so far.
The reason for having bootfs & rootfs in the list: don't know. they are part of /media. I didn't put them in there, they are automagically there. My setup: Raspi3B+, moode flashed to SSD (on usb) and on th sdCard there's bootcode.bin for succefsul boots. that's not an ideal setup. my Pi4 is coming in like a month. On Pi 3 it might be better to bot from SD card...
But let me recap what I found so far.
- MPD uses /var/lib/mpd/music to find it's music
- thumb-gen uses:
Code:
$mntDirs = str_replace("\n", ', ', shell_exec('ls /mnt'));
$mediaDirs = str_replace("\n", ', ', shell_exec('ls /media'));
in /media it adds a /USB in front of all entries.
if entries are in /mnt and /media, they are duplicated.
Code:
Scanning: NAS, SDCARD, VINYL, BOOTFS, rootfs, VINYL
And I think here's a bug. But, please doublecheck :
The original list-songfiles.sh used
Code:
find "/mnt/${DIRS[$i]}"
so, my new / "fixed" code looks like this:
Code:
find "/mnt/${DIRS[$i]}/" -depth -mindepth 1 -type f -iregex ".*\.${TYPES_REGEX}" -printf "file: ""${DIRS[$i]}/""%P\n"
The difference between thos two versions is (on my example playground):
Code:
Done: 4 folders scanned, 4 thumbs created, 0 already in cache.
vs
Done: 6 folders scanned, 6 thumbs created, 0 already in cache.
Bonus fact: None of this methods uses
Code:
const ROOT_DIRECTORIES
Kind regards,
Martin