Plugin: Pitchfork Album Reviews (looking for testers)


#1

I’ve created a hacky plugin that grabs album reviews from Pitchfork, you can find it here: https://github.com/fortes/beets-pitchfork

To install, run:

pip install git+git://github.com/fortes/beets-pitchfork.git@master

And add pitchfork to your plugin list.

You can now add reviews via the pitchfork command, like this: beet pitchfork kendrick lamar (be nice to Pitchfork’s servers, and don’t try to query your entire library at once!)

The plugin adds the following flexible album attributes:

  • pitchfork_bnm: Whether the album was awarded “Best New Music”
  • pitchfork_description: Album abstract
  • pitchfork_score: Numeric score given by p4k
  • pitchfork_url: The URL to the review

The plugin uses the full album name & album artist name, which means matches are not always found. I’m not yet sure how to best fix this, so I’m open to ideas!

A help question from me: I’ve tried using %ifdef{pitchfork_score,$pitchfork_score} in format_album config, but it will output $pitchfork_score when the value isn’t present. What am I doing wrong?


#2

Wow; this looks awesome! Nice work.

Your syntax for ifdef seems right, so this might be a beets bug. In fact, just %ifdef{pitchfork_score} should do it. Maybe something’s wrong with our implementation of the function?


#3

Ah, looks like %ifdef{pitchfork_score} returns 0.0, which I can live with. Thanks.

Related: Is there anything like the inline plugin’s album_type for format_album?


#4

Hmm, I’m not quite sure I understand—what’s the album_type you’re referring to? Is this something inline-specific?


#5

Sorry, that’s a typo – I meant album_fields: https://beets.readthedocs.io/en/v1.4.7/plugins/inline.html#album-fields


#6

It should be possible to use inline-defined album fields in format_album; sure.

Or perhaps you’re asking whether it’s possible to use template syntax to define new fields? Not currently, unfortunately, but it would be pretty cool…


#7

Another stupid typo on my part, got it working now. Thanks!