Time to rethink path formats?

The path formats feature is great for basic use, but it gets messy quickly. I want my music library organized just-so, and the way I do that in beets is cumbersome. Maybe it’s my Python bias speaking, but I think a pure Python solution would be easier to follow than a translation layer between text and the underlying Python.

In my config, I define a fake comment and fake tab using regex, that allows cleaner line breaks that line up with the surrounding lines.

Then I spin a tangled web of if-elses, which are hard to understand. Without line breaks, it’s impossible.

Granted, nobody but me does fake comments. Can people with advanced path formats share their configs? Do you create them in your YAML, or do you have to conceptualize them elsewhere because the if-else chains are too messy and there are no comments?

Should I put all the logic into inline's album_fields and item_fields? The complicated functions go there but my base logic is still in the normal path formatter. Are template functions available when using inline?

Interesting! I’d be interested to hear how others tackle this sort of thing too. It is perhaps worth exploring the “all-inline” approach to see how far it can take you.

I don’t think it’s currently possible to call template functions from within inline expressions, but that would be a cool thing to add to support this sort of use case!

Ah, I had forgotten we had recently discussed this possibility and found a tricky way to do it:

Kinda off-topic, but sometimes I wished that the path: entries were Jinja2 templates. But that could open another can of worms

1 Like