Skip to content

TagSpaces is an offline, open source, document manager with tagging support

list meta folder files

Borislav Sapundzhiev81babd8b16e0
diff --git a/data/js/core.api.js b/data/js/core.api.js
index f7f98e0e7..a2229e735 100644
--- a/data/js/core.api.js
+++ b/data/js/core.api.js
@@ -26,6 +26,8 @@ define(function(require, exports, module) {
var fileList = [];
// List of the sub directories of the current directory
var subDirsList = [];
+ // List of meta files
+ var metaFileList = [];
// Last clicked button for removing a tag
var selectedTag = '';
var selectedTagData = '';
@@ -646,4 +648,5 @@ define(function(require, exports, module) {
//document events
exports.createDocumentEvent = createDocumentEvent;
exports.fireDocumentEvent = fireDocumentEvent;
+ exports.metaFileList = metaFileList;
});
diff --git a/data/js/directories.ui.js b/data/js/directories.ui.js
index 016af5e7b..6cb73dd97 100644
--- a/data/js/directories.ui.js
+++ b/data/js/directories.ui.js
@@ -355,6 +355,9 @@ define(function(require, exports, module) {
}
console.log('Dir History: ' + JSON.stringify(directoryHistory));
TSCORE.currentPath = directoryPath;
+ if(TSCORE.IO.getDirectoryMetaInformation) {
+ TSCORE.IO.getDirectoryMetaInformation(directoryPath);
+ }
TSCORE.IO.listDirectory(directoryPath);
}
diff --git a/data/node-webkit/node-webkit.api.js b/data/node-webkit/node-webkit.api.js
index 6cbb4a50e..355ad467a 100644
--- a/data/node-webkit/node-webkit.api.js
+++ b/data/node-webkit/node-webkit.api.js
@@ -516,6 +516,39 @@ define(function(require, exports, module) {
}
};
+ var getDirectoryMetaInformation = function(dirPath) {
+ dirPath = dirPath + "/ts";
+ console.log("getDirectoryMetaInformation directory: " + dirPath);
+ try {
+ fs.readdir(dirPath, function(error, dirList) {
+ if (error) {
+ console.log("Listing directory: " + dirPath + " failed " + error);
+ return;
+ }
+
+ var anotatedDirList = [];
+ for (var i = 0; i < dirList.length; i++) {
+ var path = dirPath + TSCORE.dirSeparator + dirList[i];
+ var stats = fs.lstatSync(path);
+ if (stats !== undefined) {
+ //console.log('stats: ' + JSON.stringify(stats));
+ anotatedDirList.push({
+ "name": dirList[i],
+ "isFile": stats.isFile(),
+ "size": stats.size,
+ "lmdt": stats.mtime,
+ "path": path
+ });
+ }
+ }
+ //TSPOSTIO.listDirectory(anotatedDirList);
+ TSCORE.metaFileList = anotatedDirList;
+ });
+ } catch (ex) {
+ console.error("Listing directory " + dirPath + " failed " + ex);
+ }
+ };
+
var deleteElement = function(path) {
console.log("Deleting: " + path);
@@ -704,4 +737,5 @@ define(function(require, exports, module) {
exports.showMainWindow = showMainWindow;
exports.getFile = getFile;
exports.getFileContent = getFileContent;
+ exports.getDirectoryMetaInformation = getDirectoryMetaInformation;
});