Prevent the media scanner from never quitting
This commit is contained in:
@@ -420,7 +420,10 @@ MediaScanner::scan(boost::system::error_code err)
|
||||
{
|
||||
for (auto& addon : _addons)
|
||||
addon->preScanComplete();
|
||||
}
|
||||
|
||||
if (_running)
|
||||
{
|
||||
stats.stopTime = Wt::WLocalDateTime::currentDateTime().toUTC();
|
||||
{
|
||||
std::unique_lock<std::mutex> lock {_statusMutex};
|
||||
@@ -471,6 +474,13 @@ MediaScanner::refreshScanSettings()
|
||||
addon->refreshSettings();
|
||||
}
|
||||
|
||||
void MediaScanner::notifyInProgress(Stats& stats)
|
||||
{
|
||||
std::chrono::system_clock::time_point now {std::chrono::system_clock::now()};
|
||||
_sigScanInProgress(stats);
|
||||
_lastScanInProgressEmit = now;
|
||||
}
|
||||
|
||||
void MediaScanner::notifyInProgressIfNeeded(Stats& stats)
|
||||
{
|
||||
std::chrono::system_clock::time_point now {std::chrono::system_clock::now()};
|
||||
@@ -674,6 +684,8 @@ MediaScanner::scanMediaDirectory(boost::filesystem::path mediaDirectory, bool fo
|
||||
|
||||
itPath.increment(ec);
|
||||
}
|
||||
|
||||
notifyInProgress(stats);
|
||||
}
|
||||
|
||||
// Check if a file exists and is still in a media directory
|
||||
|
||||
Reference in New Issue
Block a user