mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-20 01:25:37 +01:00
[#836] Added import command user feedback
This commit is contained in:
parent
d7dce0ac34
commit
00a28e283b
@ -78,14 +78,18 @@ public class ManageImportCommand extends CommandNode {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
findImporter(sender, importArg);
|
findAndProcessImporter(sender, importArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findImporter(Sender sender, String importArg) {
|
private void findAndProcessImporter(Sender sender, String importArg) {
|
||||||
Optional<Importer> foundImporter = importSystem.getImporter(importArg);
|
Optional<Importer> foundImporter = importSystem.getImporter(importArg);
|
||||||
if (foundImporter.isPresent()) {
|
if (foundImporter.isPresent()) {
|
||||||
Importer importer = foundImporter.get();
|
Importer importer = foundImporter.get();
|
||||||
processing.submitNonCritical(importer::processImport);
|
processing.submitNonCritical(() -> {
|
||||||
|
sender.sendMessage(locale.getString(ManageLang.PROGRESS_START));
|
||||||
|
importer.processImport();
|
||||||
|
sender.sendMessage(locale.getString(ManageLang.PROGRESS_SUCCESS));
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(locale.getString(ManageLang.FAIL_IMPORTER_NOT_FOUND, importArg));
|
sender.sendMessage(locale.getString(ManageLang.FAIL_IMPORTER_NOT_FOUND, importArg));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user