mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-22 18:56:00 +02:00
* Add getAvailableFileAreaTags()
* Properly check area tags for system internal
This commit is contained in:
parent
f105c25e17
commit
59da1a2461
1 changed files with 7 additions and 1 deletions
|
@ -28,6 +28,7 @@ const moment = require('moment');
|
||||||
|
|
||||||
exports.isInternalArea = isInternalArea;
|
exports.isInternalArea = isInternalArea;
|
||||||
exports.getAvailableFileAreas = getAvailableFileAreas;
|
exports.getAvailableFileAreas = getAvailableFileAreas;
|
||||||
|
exports.getAvailableFileAreaTags = getAvailableFileAreaTags;
|
||||||
exports.getSortedAvailableFileAreas = getSortedAvailableFileAreas;
|
exports.getSortedAvailableFileAreas = getSortedAvailableFileAreas;
|
||||||
exports.isValidStorageTag = isValidStorageTag;
|
exports.isValidStorageTag = isValidStorageTag;
|
||||||
exports.getAreaStorageDirectoryByTag = getAreaStorageDirectoryByTag;
|
exports.getAreaStorageDirectoryByTag = getAreaStorageDirectoryByTag;
|
||||||
|
@ -48,10 +49,11 @@ exports.updateAreaStatsScheduledEvent = updateAreaStatsScheduledEvent;
|
||||||
const WellKnownAreaTags = exports.WellKnownAreaTags = {
|
const WellKnownAreaTags = exports.WellKnownAreaTags = {
|
||||||
Invalid : '',
|
Invalid : '',
|
||||||
MessageAreaAttach : 'system_message_attachment',
|
MessageAreaAttach : 'system_message_attachment',
|
||||||
|
TempDownloads : 'system_temporary_download',
|
||||||
};
|
};
|
||||||
|
|
||||||
function isInternalArea(areaTag) {
|
function isInternalArea(areaTag) {
|
||||||
return areaTag === WellKnownAreaTags.MessageAreaAttach;
|
return [ WellKnownAreaTags.MessageAreaAttach, WellKnownAreaTags.TempDownloads ].includes(areaTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAvailableFileAreas(client, options) {
|
function getAvailableFileAreas(client, options) {
|
||||||
|
@ -77,6 +79,10 @@ function getAvailableFileAreas(client, options) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getAvailableFileAreaTags(client, options) {
|
||||||
|
return _.map(getAvailableFileAreas(client, options), area => area.areaTag);
|
||||||
|
}
|
||||||
|
|
||||||
function getSortedAvailableFileAreas(client, options) {
|
function getSortedAvailableFileAreas(client, options) {
|
||||||
const areas = _.map(getAvailableFileAreas(client, options), v => v);
|
const areas = _.map(getAvailableFileAreas(client, options), v => v);
|
||||||
sortAreasOrConfs(areas);
|
sortAreasOrConfs(areas);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue