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?
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?
Glad you liked it @reg, I’m open to adding other sites, however I haven’t really found much that has a lot of reviews and easy access. I looked at CritiqueBrainz, but it seems to have very few reviews.
I’d love to use rateyoumusic, but they don’t have an API and scraping is against their TOS
Regarding use of template syntax for fields, format_fields plugin might be of interest. I do think it’d be nice to provide the apply_template function to inline functions, though, so inline can explicitly evaluate a template.
I use it in combination with inline. A bit messy, might be cleaner to try to combine the two, but it works for now and avoids some duplication in my path formats.
Ex.:
format_fields:
album_fields:
incomplete: '%if{$tracktotal,%if{$missing,1,0},0}'
# Used in path formats
albumsdir: '%if{$tracktotal,%if{$missing,Incomplete ,}}Albums'
album_directory_alldiscs: '%the{$album%aunique{}}$explicit_or_clean_album'
_album_directory: '$album%aunique{}%if{$multidisc, Disc $trim_disc}%if{$disctitle,: $disctitle}$explicit_or_clean_album'
albumartistdir: '%asciify{%first{$comp_albumartist}}'
# Fallback from item for other contexts
album_directory: '$album_directory_alldiscs'
item_fields:
# Used in path formats
# singleton is an item field, not an album field, obviously..
album_directory: '%if{$singleton,[non-album tracks],$album_directory_alldiscs}'
full_title: '$title%ifdef{itunesadvisory,$explicit_or_clean}'
comp_filename: '%if{$singleton,,$disc_and_track_pre}%if{$comp,$artist - $full_title,$full_title}'
alternatives:
dap:
default: '%if{$single_track,Single Tracks/$artist - $title,$albumsdir/$albumartistdir/$album_directory/$comp_filename}'
Strange, I don’t have lxml installed in my virtualenv at all, and I’m not getting any error but I’m on Linux. beets-pitchfork doesn’t call into lxml at all, maybe one of the dependencies does outside of Linux?