diff --git a/ui (gen4)/features/collections.js b/ui (gen4)/features/collections.js index 74cd7607..94b6a297 100755 --- a/ui (gen4)/features/collections.js +++ b/ui (gen4)/features/collections.js @@ -2097,6 +2097,9 @@ module.CollectionTags = core.ImageGridFeatures.Feature({ }) }], // load collection local tags from .data.tags to .local_tags... + // ...this is needed if the collections are fully loaded as part + // of the index... + // XXX do we actually need this??? ['load', function(_, json){ var that = this @@ -2109,17 +2112,17 @@ module.CollectionTags = core.ImageGridFeatures.Feature({ // do the loading... .forEach(function(title){ var c = that.collections[title] - if(!c){ + + if(!c || !c.data){ return } - var t = (c.data || {}).tags || {} - /* XXX do we need this??? - c.local_tags = c.local_tags || {} + var t = (c.data.tags || {}).tags || {} + var lt = c.local_tags = c.local_tags || {} + ;(that.config['collection-local-tags'] || []) .forEach(function(tag){ - c.local_tags[tag] = new Set(c.local_tags[tag] || t[tag] || []) }) - //*/ + lt[tag] = new Set(lt[tag] || t[tag] || []) }) }) }], ], diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index f485e13f..15edcd98 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -1038,7 +1038,7 @@ var CommentsActions = actions.Actions({ // ... // }, // - // : , + // : , // ... // } __comments: null, @@ -1158,22 +1158,24 @@ var FileSystemCommentsActions = actions.Actions({ return Promise.all(loaded.map(function(path){ var comments_dir = that.config['index-dir'] +'/comments' - return file.loadIndex(path, that.config['index-dir'] +'/comments', date, logger) + return file.loadIndex(path +'/'+ comments_dir, false, date, logger) .then(function(res){ + var c = res[path +'/'+ comments_dir] + // no comments present... - if(res[path] == null){ + if(c == null){ return res } // if we have no sub-indexes just load the // comments as-is... if(loaded.length == 1){ - that.comments = JSON.parse(JSON.stringify(res[path])) - that.comments.raw = {path: res[path]} + that.comments = JSON.parse(JSON.stringify(c)) + that.comments.raw = {path: c} // sub-indexes -> let the client merge their stuff... } else { - that.comments.raw[path] = res[path] + that.comments.raw[path] = c } return res @@ -1287,9 +1289,19 @@ var FileSystemSaveHistoryActions = actions.Actions({ loadSaveHistoryList: ['- File/', function(path){ - path = path || this.location.path + var index_dir = this.config['index-dir'] + path = path || this.location.loaded + path = path instanceof Array ? path : [path] - return file.loadSaveHistoryList(path) + var res = {} + return Promise + .all(this.location.loaded + .map(function(path){ + return file.loadSaveHistoryList(path +'/'+ index_dir) + .then(function(data){ + res[path] = data }) })) + .then(function(){ + return res }) }], }) diff --git a/ui (gen4)/features/meta.js b/ui (gen4)/features/meta.js index b408d4ed..a801f4b5 100755 --- a/ui (gen4)/features/meta.js +++ b/ui (gen4)/features/meta.js @@ -177,8 +177,9 @@ core.ImageGridFeatures.Feature('imagegrid-testing', [ //----------------------------------------------------- testing --- 'experiments', '-tests', + // XXX this is really slow on load, need to speed the search up... - '-comments', + //'-comments', // missing suggested feature test -- should show up in .features.missing... 'missing-feature', diff --git a/ui (gen4)/imagegrid/file.js b/ui (gen4)/imagegrid/file.js index edcc5b77..f1ef5255 100755 --- a/ui (gen4)/imagegrid/file.js +++ b/ui (gen4)/imagegrid/file.js @@ -354,6 +354,8 @@ function(path, index_dir, logger){ .on('end', function(files){ var data = groupByDate(files) + console.log('>>>>>', data) + // XXX should we mark the root timestamp in any way??? if('root' in data && data.root.length > 0){ // XXX handle stat error...