Filter out system areas

This commit is contained in:
Bryan Ashby 2017-09-26 10:43:22 -06:00
parent 8479091d33
commit e555a28160
1 changed files with 14 additions and 8 deletions

View File

@ -2,13 +2,14 @@
'use strict'; 'use strict';
// ENiGMA½ // ENiGMA½
const msgArea = require('./message_area.js'); const msgArea = require('./message_area.js');
const MenuModule = require('./menu_module.js').MenuModule; const MenuModule = require('./menu_module.js').MenuModule;
const ViewController = require('./view_controller.js').ViewController; const ViewController = require('./view_controller.js').ViewController;
const stringFormat = require('./string_format.js'); const stringFormat = require('./string_format.js');
const FileEntry = require('./file_entry.js'); const FileEntry = require('./file_entry.js');
const FileBaseFilters = require('./file_base_filter.js'); const FileBaseFilters = require('./file_base_filter.js');
const Errors = require('./enig_error.js').Errors; const Errors = require('./enig_error.js').Errors;
const { getAvailableFileAreaTags } = require('./file_base_area.js');
// deps // deps
const _ = require('lodash'); const _ = require('lodash');
@ -166,8 +167,13 @@ exports.getModule = class NewScanModule extends MenuModule {
newScanFileBase(cb) { newScanFileBase(cb) {
// :TODO: add in steps // :TODO: add in steps
const filterCriteria = {
newerThanFileId : FileBaseFilters.getFileBaseLastViewedFileIdByUser(this.client.user),
areaTag : getAvailableFileAreaTags(this.client),
};
FileEntry.findFiles( FileEntry.findFiles(
{ newerThanFileId : FileBaseFilters.getFileBaseLastViewedFileIdByUser(this.client.user) }, filterCriteria,
(err, fileIds) => { (err, fileIds) => {
if(err || 0 === fileIds.length) { if(err || 0 === fileIds.length) {
return cb(err ? err : Errors.DoesNotExist('No more new files')); return cb(err ? err : Errors.DoesNotExist('No more new files'));