bugfix + cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-05-23 18:36:53 +03:00
parent 00e36efce2
commit 14a0d3c3ba
2 changed files with 7 additions and 13 deletions

View File

@ -182,7 +182,8 @@ var CLIActions = actions.Actions({
handleLogItem: ['- System/',
function(logger, path, status, ...rest){
var msg = path.join(': ')
var l = (rest.length == 1 && rest[0] instanceof Array) ?
var l = (rest.length == 1
&& rest[0] instanceof Array) ?
rest[0].length
: rest.length
@ -515,16 +516,7 @@ var CLIActions = actions.Actions({
return Promise.all([
// NOTE: no need to call .cacheMetadata(..) as
// it is already running after .loadImages(..)
// XXX BUG: for some reason this reports making previews
// but does not actually make them...
// XXX .makePreviews(..) called from cli reports
// creating images but does not...
// ...we seem to be reacing .makeResizedImage(..)
// but them something odd happens -- nether of
// the .then(..) callbacks is called...
// ...even weirder, code before the call executes
// while wrapping the call in a console.log(..)
// produces nothing, not even a syntax error...
// XXX we seem not to be reporting errors here (cli)...
index.makePreviews('all') ])} })
.then(function(){
return index

View File

@ -712,8 +712,10 @@ var SharpActions = actions.Actions({
// this is a small list and in this way we can take
// advantage of OS file caching, and removing the queue
// overhead, though small makes this noticeably faster...
// XXX seems that we have a stray global 'name' variable
// in gui mode...
return that.makeResizedImage('sync', [[source, target]], size, null, {
name,
//name: target,
skipSmaller: true,
transform: false,
overwrite: false,
@ -735,7 +737,7 @@ var SharpActions = actions.Actions({
that.markChanged
&& that.markChanged('images', [gid]) }
//*/
return [gid, size, name] },
return [gid, size, target] },
function(err){
logger
&& logger.emit('skipped', `${gid} / ${size}`) }) })) })],