You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In occasions if it's avoided to deep search (all directories from parent directory set on player) for applications as audio player with browser (as my project) when one directory includes a lot of files and subdirectories with more files, the AudioKit works agilest.
The modification that I'm suggesting is below (or similar up to you).
I tested this one and works very fine, now AudioKit for example in that critical case it is not freezed and takes a short time to discover all files (only in the directory that user sees)
/// Writes the index file
void listDir(Print &idxfile, const char *dirname) {
LOGD("listDir: %s", dirname);
FileT root = open(dirname);
if (!root) {
LOGE("Open failed: %s", dirname);
popPath();
return;
}
if (!isDirectory(root)) {
LOGD("Is not directory: %s", dirname);
popPath();
return;
}
if (StrView(dirname).startsWith(".")) {
LOGD("Invalid file: %s", dirname);
popPath();
return;
}
rewind(root);
FileT file = openNext(root);
while (file) {
if (isDirectory(file)) {
<---------------------------- Here is the suggestion
if( !disableDeepSearching ) {
String name = String(fileNamePath(file));
LOGD("name: %s", name.c_str());
pushPath(fileName(file));
listDir(idxfile, name.c_str());
}
----------------------------->
} else {
const char *fn = fileNamePath(file);
if (isValidAudioFile(file)) {
LOGD("Adding file to index: %s", fn);
idxfile.println(fn);
} else {
LOGD("Ignoring %s", fn);
}
}
file = openNext(root);
}
popPath();
}
On the other hand.
About reindex forced, I have tested it but at the end I have to remove index files to achieve that these one will be regenerated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @pschatzmann.
In occasions if it's avoided to deep search (all directories from parent directory set on player) for applications as audio player with browser (as my project) when one directory includes a lot of files and subdirectories with more files, the AudioKit works agilest.
The modification that I'm suggesting is below (or similar up to you).
I tested this one and works very fine, now AudioKit for example in that critical case it is not freezed and takes a short time to discover all files (only in the directory that user sees)
On the other hand.
About reindex forced, I have tested it but at the end I have to remove index files to achieve that these one will be regenerated.
Any idea?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions