mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-03 16:31:59 +02:00
* Bump version to 0.0.2-alpha: File Base alpha here
* LHA/LZH archive support via external lha command * Nearly complete upload processor * Set default file base filter if none is set * Additional MenuModule common method/helpers * MLTEV property: tabSwitchesView
This commit is contained in:
parent
8d51c7d47c
commit
99036592ae
14 changed files with 269 additions and 109 deletions
|
@ -280,7 +280,7 @@ module.exports = class FileEntry {
|
|||
sqlWhere += clause;
|
||||
}
|
||||
|
||||
if(filter.sort) {
|
||||
if(filter.sort && filter.sort.length > 0) {
|
||||
if(Object.keys(FILE_WELL_KNOWN_META).indexOf(filter.sort) > -1) { // sorting via a meta value?
|
||||
sql =
|
||||
`SELECT f.file_id
|
||||
|
@ -294,7 +294,7 @@ module.exports = class FileEntry {
|
|||
`SELECT f.file_id, f.${filter.sort}
|
||||
FROM file f`;
|
||||
|
||||
sqlOrderBy = getOrderByWithCast(`f.${filter.sort}`) + sqlOrderDir;
|
||||
sqlOrderBy = getOrderByWithCast(`f.${filter.sort}`) + ' ' + sqlOrderDir;
|
||||
}
|
||||
} else {
|
||||
sql =
|
||||
|
@ -305,11 +305,11 @@ module.exports = class FileEntry {
|
|||
}
|
||||
|
||||
|
||||
if(filter.areaTag) {
|
||||
if(filter.areaTag && filter.areaTag.length > 0) {
|
||||
appendWhereClause(`f.area_tag="${filter.areaTag}"`);
|
||||
}
|
||||
|
||||
if(filter.terms) {
|
||||
if(filter.terms && filter.terms.length > 0) {
|
||||
appendWhereClause(
|
||||
`f.file_id IN (
|
||||
SELECT rowid
|
||||
|
@ -319,7 +319,7 @@ module.exports = class FileEntry {
|
|||
);
|
||||
}
|
||||
|
||||
if(filter.tags) {
|
||||
if(filter.tags && filter.tags.length > 0) {
|
||||
// build list of quoted tags; filter.tags comes in as a space separated values
|
||||
const tags = filter.tags.split(' ').map( tag => `"${tag}"` ).join(',');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue