mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-02 07:51:52 +02:00
Generic MIME types (file types) such as application/octet-stream can how have sub types for handlers (archive, info extract, ...)
+ Add Amiga DMS support via xdms
This commit is contained in:
parent
95422f71ba
commit
3ecadebf91
5 changed files with 108 additions and 40 deletions
|
@ -487,8 +487,19 @@ function populateFileEntryWithArchive(fileEntry, filePath, stepInfo, iterator, c
|
|||
);
|
||||
}
|
||||
|
||||
function getInfoExtractUtilForDesc(mimeType, descType) {
|
||||
let util = _.get(Config, [ 'fileTypes', mimeType, `${descType}DescUtil` ]);
|
||||
function getInfoExtractUtilForDesc(mimeType, filePath, descType) {
|
||||
let fileType = _.get(Config, [ 'fileTypes', mimeType ] );
|
||||
|
||||
if(Array.isArray(fileType)) {
|
||||
// further refine by extention
|
||||
fileType = fileType.find(ft => paths.extname(filePath) === ft.ext);
|
||||
}
|
||||
|
||||
if(!_.isObject(fileType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let util = _.get(fileType, `${descType}DescUtil`);
|
||||
if(!_.isString(util)) {
|
||||
return;
|
||||
}
|
||||
|
@ -508,7 +519,7 @@ function populateFileEntryInfoFromFile(fileEntry, filePath, cb) {
|
|||
}
|
||||
|
||||
async.eachSeries( [ 'short', 'long' ], (descType, nextDesc) => {
|
||||
const util = getInfoExtractUtilForDesc(mimeType, descType);
|
||||
const util = getInfoExtractUtilForDesc(mimeType, filePath, descType);
|
||||
if(!util) {
|
||||
return nextDesc(null);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue