Set field to URL


#1

I’m attempting to set a field on the CLI during import to a URL, and I’m getting 'supplied argument is not of the form key=value'. I’ve tried escaping the string, I’ve tried single and double quotes, all without luck.

Here’s an example you can use (it errors out during argument processing, so it doesn’t even check for the existence of the directory):

$ beet import --set import_dir='Example Artist - Example Album (2018)' --set permalink='https://example.com/releases.php?release_id=01239840' Example\ Artist\ \-\ Example\ Album\ \(2018\)
error: supplied argument `permalink=https://example.com/releases.php?release_id=01239840' is not of the form `key=value'

#2

Hmm! Looks like our parser is being a little dumb—it’s probably confused by the second = in the value. Does it work if you remove that?


#3

Removing the = from the URL allows the command to progress. Of course, now the URL is incorrect, so…


#4

OK! Can you please file a bug? The command should totally be able to handle values with = in them. (We’d just use the first = as the separator.)


#5

Done! https://github.com/beetbox/beets/issues/2984

I import albums with a python tool using beets as a library, and for those I set this field if I have a value for it. During the import I log the album object returned during the process, and I can see the custom permalink field is there, with a = in the value. However, I don’t see the custom fields when I run beet info query for track name, and I can’t seem to search with beet ls permalink:example.com

Is there a way to verify that the custom fields are set properly for the albums that auto-imported via python?


#6

Awesome; thanks!

I think what you’re seeing is that the field is being set at the album level, not the track level. So you’ll want to do a beet ls -a to query and view it.


#7

Aha, that did the trick. I didn’t realize it was only an album level field (it’s fine that it is though). Is there an equivalent of beet info for albums though? It says -a not a valid option with info.


#8

Not yet: