Skip to content

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

added support for folder thumbnails for the desktop apps

Ilian Sapundshieva6bc1f08be44
diff --git a/app/config.js b/app/config.js
index 886276403..1074d180d 100644
--- a/app/config.js
+++ b/app/config.js
@@ -27,6 +27,7 @@ export default {
metaFolder: '.ts',
metaFolderFile: 'tsm.json',
folderIndexFile: 'tsi.json',
+ folderThumbFile: 'tst.jpg',
metaFileExt: '.json',
thumbFileExt: '.jpg',
thumbType: 'image/jpeg',
diff --git a/app/services/electron-io.js b/app/services/electron-io.js
index a5ba857cd..e02907d0c 100644
--- a/app/services/electron-io.js
+++ b/app/services/electron-io.js
@@ -314,6 +314,18 @@ export default class ElectronIO {
} catch (err) {
// console.log('Failed reading meta folder file ' + folderMetaPath);
}
+
+ // Loading thumbs for folders
+ const folderTmbPath =
+ eentry.path +
+ AppConfig.dirSeparator +
+ AppConfig.metaFolder +
+ AppConfig.dirSeparator +
+ AppConfig.folderThumbFile;
+ const tmbStats = this.fs.statSync(folderTmbPath);
+ if (tmbStats.isFile()) {
+ eentry.thumbPath = folderTmbPath;
+ }
}
const fileName = eentry.name.toLowerCase();