RFC on a modify tweak

I just prototyped a little plugin that’s just a copy+modify of the modify command which interprets the value as a format string, and was looking for input as a possible enhancement, likely with a new command-line argument. Yes, it can stay a plugin, but it mostly duplicates all of modify with one small change, so…

modifytmpl command
test cases with usage in cram format.

Quick examples of usage pulled from the test:

beet modifytmpl id:1 artist_credit::'^$' artist_credit='$artist'
beet modifytmpl -a id:1 album_sort='%the{$album}'

Yay! For those who might recall, this is a feature I proposed a long time ago—many feature requests could be fulfilled by something like this or the automated, import-time equivalent:

I think we should totally do this!

Ah! Right, clearly it’s been a while since I perused the open issues :slight_smile: Looks like all that would be remaining beyond the modify change would be --set= on the import commandline, and the hypothetical proposed modify-on-import plugin? I’ll see about prepping a pull req for the first two pieces to start.

Great! The only potential problem I can imagine is surprising people if they don’t intend to use a format. We could mitigate this by having a command-line option to interpret things literally, perhaps, or by just convincing ourselves that “accidental templates” are pretty unlikely to arise.