Look for music in "/Music", with the root dir as a fallback

custom
jacqueline 8 months ago
parent 067069bf3b
commit dacf3efc45
  1. 11
      src/tangara/database/database.cpp

@ -51,6 +51,7 @@ static SingletonEnv<leveldb::EspEnv> sEnv;
[[maybe_unused]] static const char* kTag = "DB";
static const char kDbPath[] = "/.tangara-db";
static const char kMusicPath[] = "Music";
static const char kKeyDbVersion[] = "schema_version";
static const char kKeyCustom[] = "U\0";
@ -422,8 +423,14 @@ auto Database::updateIndexes() -> void {
update_tracker_->onVerificationFinished();
// Stage 2: search for newly added files.
ESP_LOGI(kTag, "scanning for new tracks");
track_finder_.launch("");
std::string root;
FF_DIR dir;
if (f_opendir(&dir, kMusicPath) == FR_OK) {
f_closedir(&dir);
root = kMusicPath;
}
ESP_LOGI(kTag, "scanning for new tracks in '%s'", root.c_str());
track_finder_.launch(root);
};
auto Database::processCandidateCallback(FILINFO& info, std::string_view path)

Loading…
Cancel
Save