When changing settings, reload the scanner in order to take new params into account
This commit is contained in:
@@ -148,11 +148,6 @@ namespace lms::scanner
|
||||
});
|
||||
}
|
||||
|
||||
void ScannerService::requestStop()
|
||||
{
|
||||
abortScan();
|
||||
}
|
||||
|
||||
void ScannerService::requestReload()
|
||||
{
|
||||
abortScan();
|
||||
|
||||
@@ -50,7 +50,6 @@ namespace lms::scanner
|
||||
ScannerService(const ScannerService&) = delete;
|
||||
ScannerService& operator=(const ScannerService&) = delete;
|
||||
|
||||
void requestStop() override;
|
||||
void requestReload() override;
|
||||
void requestImmediateScan(const ScanOptions& scanOptions) override;
|
||||
|
||||
|
||||
@@ -38,9 +38,7 @@ namespace lms::scanner
|
||||
virtual ~IScannerService() = default;
|
||||
|
||||
// Async requests
|
||||
virtual void requestStop() = 0;
|
||||
virtual void requestReload() = 0;
|
||||
|
||||
virtual void requestReload() = 0; // will stop/reschedule scan
|
||||
virtual void requestImmediateScan(const ScanOptions& options = {}) = 0;
|
||||
|
||||
enum class State
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace lms::ui
|
||||
}
|
||||
|
||||
// Don't want the scanner to go on with wrong settings
|
||||
core::Service<scanner::IScannerService>::get()->requestStop();
|
||||
core::Service<scanner::IScannerService>::get()->requestReload();
|
||||
LmsApp->notifyMsg(Notification::Type::Info, Wt::WString::tr("Lms.Admin.MediaLibraries.media-libraries"), Wt::WString::tr("Lms.Admin.MediaLibrary.library-deleted"));
|
||||
|
||||
_libraries->removeWidget(libraryEntry);
|
||||
@@ -148,7 +148,7 @@ namespace lms::ui
|
||||
updateEntry(newMediaLibraryId, entry);
|
||||
|
||||
// Don't want the scanner to go on with wrong settings
|
||||
core::Service<scanner::IScannerService>::get()->requestStop();
|
||||
core::Service<scanner::IScannerService>::get()->requestReload();
|
||||
LmsApp->notifyMsg(Notification::Type::Info, Wt::WString::tr("Lms.Admin.MediaLibraries.media-libraries"), Wt::WString::tr("Lms.settings-saved"));
|
||||
|
||||
LmsApp->getModalManager().dispose(mediaLibraryModalPtr);
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace lms::ui
|
||||
|
||||
core::Service<recommendation::IRecommendationService>::get()->load();
|
||||
// Don't want the scanner to go on with wrong settings
|
||||
core::Service<scanner::IScannerService>::get()->requestStop();
|
||||
core::Service<scanner::IScannerService>::get()->requestReload();
|
||||
LmsApp->notifyMsg(Notification::Type::Info, Wt::WString::tr("Lms.Admin.Database.database"), Wt::WString::tr("Lms.settings-saved"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user