mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-04 00:41:56 +02:00
* Default upload descriptions based on file names if no FILE_ID.DIZ/etc. could be found
* Add default desc & prompt for desc to oputil fb scan
This commit is contained in:
parent
9a2b48ac47
commit
97e19957ce
8 changed files with 67 additions and 13 deletions
|
@ -32,6 +32,7 @@ exports.getFileEntryPath = getFileEntryPath;
|
|||
exports.changeFileAreaWithOptions = changeFileAreaWithOptions;
|
||||
exports.scanFile = scanFile;
|
||||
exports.scanFileAreaForChanges = scanFileAreaForChanges;
|
||||
exports.getDescFromFileName = getDescFromFileName;
|
||||
|
||||
const WellKnownAreaTags = exports.WellKnownAreaTags = {
|
||||
Invalid : '',
|
||||
|
@ -670,3 +671,11 @@ function scanFileAreaForChanges(areaInfo, options, iterator, cb) {
|
|||
return cb(err);
|
||||
});
|
||||
}
|
||||
|
||||
function getDescFromFileName(fileName) {
|
||||
// :TODO: this method could use some more logic to really be nice.
|
||||
const ext = paths.extname(fileName);
|
||||
const name = paths.basename(fileName, ext);
|
||||
|
||||
return _.upperFirst(name.replace(/[\-_.+]/g, ' ').replace(/\s+/g, ' '));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue