diff --git a/xtrn/ddfilelister/ddfilelister.js b/xtrn/ddfilelister/ddfilelister.js index 84cfe909229e3404a1f5d13334b871663c110047..953ebe02830e8ca9f62af853742a9e2f27ffe960 100644 --- a/xtrn/ddfilelister/ddfilelister.js +++ b/xtrn/ddfilelister/ddfilelister.js @@ -115,6 +115,10 @@ * was being left there when it should have been written over with a space) * 2024-03-22 Eric Oulashin Version 2.20 * (Hopefully) Fix for descLines being undefined in getFileInfoLineArrayForTraditionalUI() + * 2024-04-08 Eric Oulashin Version 2.21 Beta + * Fix: Searching by file date as a loadable module now does the new file search + * 2024-04-09 Eric Oulashin Version 2.21 + * Releasing this version */ "use strict"; @@ -124,7 +128,6 @@ //console.ctrlkey_passthru = "+C"; //console.ctrlkey_passthru = "-C"; - // If the search action has been aborted, then return -1 if (console.aborted) exit(-1); @@ -160,8 +163,8 @@ require("attr_conv.js", "convertAttrsToSyncPerSysCfg"); // Lister version information -var LISTER_VERSION = "2.20"; -var LISTER_DATE = "2024-03-22"; +var LISTER_VERSION = "2.21"; +var LISTER_DATE = "2024-04-09"; /////////////////////////////////////////////////////////////////////////////// @@ -4097,7 +4100,7 @@ function parseArgs(argv) // Default gScriptmode to MODE_LIST_DIR; for FLBehavior as FL_NONE, no special behavior gScriptMode = MODE_LIST_DIR; - + // 2 args - Scanning/searching if (argv.length == 2) { @@ -4107,22 +4110,26 @@ function parseArgs(argv) // - 0: Bool (scanning all directories): 0/1 // - 1: FL_ mode value gScanAllDirs = (argv[0] == "1"); - if (Boolean(FLBehavior & FL_ULTIME)) - gScriptMode = MODE_NEW_FILE_SEARCH; - else if (Boolean(FLBehavior & FL_FINDDESC) || Boolean(FLBehavior & FL_EXFIND)) - gScriptMode = MODE_SEARCH_DESCRIPTION; - if (Boolean(FLBehavior & FL_VIEW)) - { - // View ZIP/ARC/GIF etc. info - // TODO: Not sure what to do with this - } } // When used as the List Files loadable module: First arg is a directory internal code - // and 2nd arg is 0 or 1 - else if (/^[^\s]+$/.test(argv[0]) && (argv[1] == "0" || argv[1] == "1")) + // and 2nd arg is list mode (FL_ mode value; see comments above starting with FL_NONE) + else if (/^[^\s]+$/.test(argv[0])) { // - 0: Directory internal code - // - 1: Bool (scanning all directories): 0/1 + if (typeof(file_area.dir[argv[0]]) === "object") + gDirCode = argv[0]; + } + + // If FL_ULTIME is set, then set the script mode to new file search + if (Boolean(FLBehavior & FL_ULTIME)) + gScriptMode = MODE_NEW_FILE_SEARCH; // List files by upload time + // If FL_FINDDESC is set, then set the script mode to search by description + else if (Boolean(FLBehavior & FL_FINDDESC) || Boolean(FLBehavior & FL_EXFIND)) + gScriptMode = MODE_SEARCH_DESCRIPTION; + if (Boolean(FLBehavior & FL_VIEW)) + { + // View ZIP/ARC/GIF etc. info + // TODO: Not sure what to do with this } } // 3 args - Internal code, mode, filespec/description keyword @@ -4373,6 +4380,9 @@ function populateFileList(pSearchMode) var userInputDLA = ""; if (gScanAllDirs) userInputDLA = "A"; + // If running as a loadable module, the sub-board would be specified + else if (gRunningAsLoadableModule) + userInputDLA = "D"; else { console.attributes = "N"; @@ -4383,17 +4393,28 @@ function populateFileList(pSearchMode) console.attributes = "N"; console.crlf(); } + // Synchronet itself seems to print the "Searching for files uploaded after..." string, so + // we don't have to print it here + /* if (userInputDLA == "D" || userInputDLA == "L" || userInputDLA == "A") { console.print("\x01n\x01cSearching for files uploaded after \x01h" + system.timestr(bbs.new_file_time) + "\x01n"); console.crlf(); } + */ var searchRetObj = searchDirGroupOrAll(userInputDLA, function(pDirCode) { - return searchDirNewFiles(pDirCode, bbs.new_file_time); + var searchDirNewFilesRetObj = searchDirNewFiles(pDirCode, bbs.new_file_time); + // If searching a single directory and no files were found, then say so + if (userInputDLA == "D" && !searchDirNewFilesRetObj.foundFiles) + { + var areaFullDesc = file_area.dir[pDirCode].lib_name + ": " + file_area.dir[pDirCode].description; + printf("\x01n\x01cNo new files found in \x01h%s\x01n\r\n", areaFullDesc); + } + return searchDirNewFilesRetObj; }); // Now bbs.last_new_file_time needs to be updated with the current time bbs.last_new_file_time = time(); - // user.new_file_time should be updated with the value of bbs.last_new_file_time + // user.new_file_time will be updated with the value of bbs.last_new_file_time // when the user logs off. allSameDir = searchRetObj.allSameDir; for (var i = 0; i < searchRetObj.errors.length; ++i) diff --git a/xtrn/ddfilelister/readme.txt b/xtrn/ddfilelister/readme.txt index b89d8abd808fca6e5226492d2a8db7e99336fcf4..3c7d83ec0495680956160a2f19d588012cb9e369 100644 --- a/xtrn/ddfilelister/readme.txt +++ b/xtrn/ddfilelister/readme.txt @@ -1,6 +1,6 @@ Digital Distortion File Lister - Version 2.20 - Release date: 2024-03-22 + Version 2.21 + Release date: 2024-04-09 by diff --git a/xtrn/ddfilelister/revision_history.txt b/xtrn/ddfilelister/revision_history.txt index 9c442475e97ee98e68d1d20d3438acf948814d69..6646f25ab398f0d3aedd22884cbf756b2467ea19 100644 --- a/xtrn/ddfilelister/revision_history.txt +++ b/xtrn/ddfilelister/revision_history.txt @@ -5,6 +5,8 @@ Revision History (change log) ============================= Version Date Description ------- ---- ----------- +2.21 2024-04-09 Fix: Searching by file date as a loadable module now does + the new file search 2.20 2024-03-22 (Hopefully) Fix for descLines undefined error 2.19 2024-03-11 File description refresh fixes when using extended descriptions (along with an updated dd_lightbar_menu.js)