New easier to manage Gopher include/exclude areas with wildcard support

* Deprecate but still support older format for now
* Add new format allowing easier management
This commit is contained in:
Bryan Ashby
2022-08-21 13:27:32 -06:00
parent 8be8c21aa8
commit c8df7f3d6b
2 changed files with 277 additions and 166 deletions

View File

@@ -1603,6 +1603,7 @@ function FTNMessageScanTossModule() {
const packetOpts = { keepTearAndOrigin: false }; // needed so we can calc message UUID without these; we'll add later
let importStats = {
packetPath,
areaSuccess: {}, // areaTag->count
areaFail: {}, // areaTag->count
otherFail: 0,
@@ -1731,19 +1732,21 @@ function FTNMessageScanTossModule() {
: 0;
};
const finalStats = Object.assign(importStats, { packetPath: packetPath });
const totalFail = makeCount(finalStats.areaFail) + finalStats.otherFail;
const totalFail = makeCount(importStats.areaFail) + importStats.otherFail;
const packetFileName = paths.basename(packetPath);
if (err || totalFail > 0) {
if (err) {
Object.assign(finalStats, { error: err.message });
Object.assign(importStats, { error: err.message });
}
Log.warn(finalStats, `Import completed with ${totalFail} error(s)`);
Log.warn(
importStats,
`Packet ${packetFileName} import reported ${totalFail} error(s)`
);
} else {
const totalSuccess = makeCount(finalStats.areaSuccess);
const totalSuccess = makeCount(importStats.areaSuccess);
Log.info(
finalStats,
`Import completed with ${totalSuccess} new message(s)`
importStats,
`Packet ${packetFileName} imported with ${totalSuccess} new message(s)`
);
}