mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +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.
|
* fixed `musikdroid` app notification on Android 13 devices.
|
||||||
* updated `musikdroid` dependencies and tooling, fixed a few warnings.
|
* updated `musikdroid` dependencies and tooling, fixed a few warnings.
|
||||||
* merged latest upstream `PDCurses` code for Windows builds.
|
* 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);
|
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) {
|
int main(int argc, char** argv) {
|
||||||
initUtf8();
|
initUtf8();
|
||||||
std::cout << "\n using lockfile at: " << getLockfileFn();
|
std::cout << "\n using lockfile at: " << getLockfileFn();
|
||||||
@ -280,6 +286,8 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
srand((unsigned int) time(0));
|
srand((unsigned int) time(0));
|
||||||
|
|
||||||
|
std::signal(SIGUSR1, rescanHandler);
|
||||||
|
|
||||||
plugin::Init();
|
plugin::Init();
|
||||||
|
|
||||||
EvMessageQueue messageQueue;
|
EvMessageQueue messageQueue;
|
||||||
|
Loading…
Reference in New Issue
Block a user