Hi Luca,
Thanks! I’m glad you like it.
Right now it supports only one folder level. We might change it in one of the next versions.
How does it search? It tries to match the search phrase first with the folder name and if it is a match, the whole folder goes in the playlist. Otherwise it tries to match each song from the folder. If there is an ID3 tag in it, it will use its data, otherwise it tries to match filename.
But, I just tested it and found two issues: First is with our matching function which currently does not account filename if it has ID3 and the second is related to ALexa which in some cases gives us search value something like this: “My Playground” by The Chikitas.
Until we release fix for it, here is the quickfix you can apply in convoworks-wp/vendor/zef-dev/convoworks-pckg-filesystem/src/Convo/Pckg/Filesystem/FilesystemMediaContext.php
Just open that file and replace _readFolderSongs() method with this one:
private function _readFolderSongs($root, DirectoryIterator $folder, $baseUrl, $artwork, $background, $search = null, $minMatchPercentage = self::MIN_MATCH_PERCENT)
{
if (preg_match('/"([^"]+)"/', $search, $m)) {
$search = $m[1];
}
$songs = [];
foreach (new DirectoryIterator($folder->getRealPath()) as $folder_file) {
if ($folder_file->isDot() || !$folder_file->isFile()) {
continue;
}
if (\strtolower($folder_file->getExtension()) !== 'mp3') {
continue;
}
if ($root) {
$file_url = $baseUrl . '/' . \rawurlencode($folder_file->getFilename());
} else {
$file_url = $baseUrl . '/' . \rawurlencode($folder->getFilename()) . '/' . \rawurlencode($folder_file->getFilename());
}
$song = new Mp3Id3File($folder_file->getRealPath(), $file_url, $artwork, $background);
if ($search) {
if ( $this->_acceptsSong( $song, $search, $minMatchPercentage)) {
$songs[] = $song;
} else if ( stripos( $folder_file->getBasename(), $search) !== false) {
$songs[] = $song;
}
} else {
$songs[] = $song;
}
}
return $songs;
}