mirror of
https://github.com/clangen/musikcube.git
synced 2024-12-30 12:16:00 +00:00
Use SIGUSR1 to rescan library in musikcubed
This commit is contained in:
parent
8d694c3680
commit
3998b759f7
@ -5,6 +5,7 @@
|
||||
* fixed `musikdroid` app notification on Android 13 devices.
|
||||
* updated `musikdroid` dependencies and tooling, fixed a few warnings.
|
||||
* merged latest upstream `PDCurses` code for Windows builds.
|
||||
* sending `musikcubed` a SIGUSR1 will trigger a library rescan.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -270,6 +270,12 @@ static void initUtf8() {
|
||||
boost::filesystem::path::imbue(utf8Locale);
|
||||
}
|
||||
|
||||
static void rescanHandler(int signal) {
|
||||
debug::info("daemon", "received SIGUSR1, rescanning the library...");
|
||||
auto library = LibraryFactory::Instance().DefaultLocalLibrary();
|
||||
library->Indexer()->Schedule(IIndexer::SyncType::All);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
initUtf8();
|
||||
std::cout << "\n using lockfile at: " << getLockfileFn();
|
||||
@ -280,6 +286,8 @@ int main(int argc, char** argv) {
|
||||
|
||||
srand((unsigned int) time(0));
|
||||
|
||||
std::signal(SIGUSR1, rescanHandler);
|
||||
|
||||
plugin::Init();
|
||||
|
||||
EvMessageQueue messageQueue;
|
||||
|
Loading…
Reference in New Issue
Block a user