Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: --filter-input #68

Closed
rprieto opened this issue Jun 9, 2017 · 3 comments
Closed

New feature: --filter-input #68

rprieto opened this issue Jun 9, 2017 · 3 comments
Labels
enhancement New feature or functionality

Comments

@rprieto
Copy link
Member

rprieto commented Jun 9, 2017

What about the idea of an input filter? Only the files that pass the filter would be processed and resized, and appear in the galleries. It could be a new CLI argument, parsed with https://www.npmjs.com/package/safe-eval:

--filter-input "file => file.meta.favourite === true"

Or maybe passing the path to a Node.js module:

--filter-input-path ~/filter.js

And the filter script can look like:

// filter.js
module.exports = (file) => {

  // based on the file path
  return file.path.match(/holidays/)
  
  // or based on metadata
  return file.meta.favourite === true
  return file.meta.rating > 4
  return file.meta.keywords.include('holidays')

}
@rprieto rprieto added the enhancement New feature or functionality label Aug 13, 2017
@rprieto
Copy link
Member Author

rprieto commented Jan 24, 2019

Cleaning up the issues, will re-open if this becomes a priority.

@rprieto rprieto closed this as completed Jan 24, 2019
@seanakabry
Copy link

Is include() a typo? Should it be includes()?

(Just in case this saves Javascript novices like me a bit of time!)

@rprieto
Copy link
Member Author

rprieto commented Dec 22, 2022

Hi. Yes you’re right the correct array syntax is .includes().

However this issue was a feature idea, which is not yet implemented.

For now you can’t filter the input, but you can create custom albums like --albums-from "file://mapper.js".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or functionality
Projects
None yet
Development

No branches or pull requests

2 participants