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

Reorder configuration data structure #17

Open
FichteFoll opened this issue May 17, 2020 · 0 comments
Open

Reorder configuration data structure #17

FichteFoll opened this issue May 17, 2020 · 0 comments

Comments

@FichteFoll
Copy link

FichteFoll commented May 17, 2020

The current configuration is structured as follows:

extrafiles:
  patterns:
    artworkdir:
      - '[sS]cans/'
      - '[aA]rtwork/'
  paths:
      artworkdir: $albumpath/artwork

Here, patterns and paths are keyed by a user-defined name to relate the two different setting parts to each other.

However, they live in a 1:1 relation (or 1:0 if no path is specified) and there is no option apply a path format to multiple patterns, so it would be cleaner to combine them into a single element and get rid of the name abstraction as follows:

extrafiles:
  rules:
    - patterns:
        - '[sS]cans/'
        - '[aA]rtwork/'
      path: $albumpath/artwork

This way, all the options relevant to one pattern group are closely next to each other, which makes the configuration easier to read (less jumping around) and easier to write (no way to misspell the group name).

Another advantage is that rules can be cleanly matched in order and don't depend on however the order of the internal dictionary happens to be (which should be in parse order for Python 3.6+ but is undefined for older versions).

Please correct me if I made a wrong conclusion from the README or source.

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

No branches or pull requests

1 participant