Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi library support #410

Merged
merged 2 commits into from
Jan 26, 2024
Merged

Multi library support #410

merged 2 commits into from
Jan 26, 2024

Conversation

epoupon
Copy link
Owner

@epoupon epoupon commented Jan 26, 2024

No description provided.

Comment on lines +222 to +279
switch (status.currentState)
{
case IScannerService::State::NotScheduled:
_status->setText(Wt::WString::tr("Lms.Admin.ScannerController.status-not-scheduled"));
_stepStatus->setText("");
break;
case IScannerService::State::Scheduled:
_status->setText(Wt::WString::tr("Lms.Admin.ScannerController.status-scheduled")
.arg(status.nextScheduledScan.toString()));
_stepStatus->setText("");
break;
case IScannerService::State::InProgress:
_status->setText(Wt::WString::tr("Lms.Admin.ScannerController.status-in-progress")
.arg(static_cast<int>(status.currentScanStepStats->currentStep) + 1)
.arg(Scanner::ScanProgressStepCount));

switch (status.currentScanStepStats->currentStep)
{
case Scanner::ScanStep::CheckingForDuplicateFiles:
_stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-checking-for-duplicate-files")
.arg(status.currentScanStepStats->processedElems));
break;

case Scanner::ScanStep::ChekingForMissingFiles:
_stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-checking-for-missing-files")
.arg(status.currentScanStepStats->progress()));
break;

case Scanner::ScanStep::DiscoveringFiles:
_stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-discovering-files")
.arg(status.currentScanStepStats->processedElems));
break;

case Scanner::ScanStep::ScanningFiles:
_stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-scanning-files")
.arg(status.currentScanStepStats->processedElems)
.arg(status.currentScanStepStats->totalElems)
.arg(status.currentScanStepStats->progress()));
break;

case Scanner::ScanStep::FetchingTrackFeatures:
_stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-fetching-track-features")
.arg(status.currentScanStepStats->processedElems)
.arg(status.currentScanStepStats->totalElems)
.arg(status.currentScanStepStats->progress()));
break;

case Scanner::ScanStep::ReloadingSimilarityEngine:
_stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-reloading-similarity-engine")
.arg(status.currentScanStepStats->progress()));
break;

case Scanner::ScanStep::ComputeClusterStats:
_stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-compute-cluster-stats")
.arg(status.currentScanStepStats->progress()));
}
break;
}

Check notice

Code scanning / CodeQL

Long switch case Note

Switch has at least one case that is too long:
InProgress (45 lines)
.
using IdType = typename T::IdType;

template <typename... Args>
ScopedEntity(Database::Session& session, Args&& ...args)

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable args is not used.
{
auto transaction{ LmsApp->getDbSession().createReadTransaction() };

if (Wt::asNumber(value(DemoField)) && User::findDemoUser(LmsApp->getDbSession()))

Check warning

Code scanning / CodeQL

Lossy function result cast Warning

Return value of type double is implicitly converted to bool.
return user->getType();
}

return Wt::asNumber(value(DemoField)) ? UserType::DEMO : UserType::REGULAR;

Check warning

Code scanning / CodeQL

Lossy function result cast Warning

Return value of type double is implicitly converted to bool.
// Create user
user = LmsApp->getDbSession().create<User>(valueText(LoginField).toUTF8());

if (Wt::asNumber(value(DemoField)))

Check warning

Code scanning / CodeQL

Lossy function result cast Warning

Return value of type double is implicitly converted to bool.
@epoupon epoupon merged commit 9461b2a into develop Jan 26, 2024
12 checks passed
@epoupon epoupon deleted the multi-library branch November 15, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant