Project

coverart

0.0
Low commit activity in last 3 years
No release in over a year
A tiny client for the Cover Art Archive web service
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Coverart

A tiny client for the Cover Art Archive web service.

It works great with the Musicbrainz client.

Gem Version CI Status Maintainability Test Coverage

Installation

bundle add coverart

Usage

You should first read the JSON API manual by Musicbrainz.

require "coverart"

client = Coverart::Client.new
client.get("/release/76df3287-6cda-33eb-8e9a-044b5e15ffdd")

You can also use shortcuts :

# Get the front image URL
client.front("76df3287-6cda-33eb-8e9a-044b5e15ffdd")

# Get the back image URL
client.back("99b09d02-9cc9-3fed-8431-f162165a9371")

# Get the front image URL for a release group
client.group("76df3287-6cda-33eb-8e9a-044b5e15ffdd")

Caching & middlewares

In order to perform caching, you can use faraday_middleware or your own middlewares:

# FYI: faraday_middleware and active_support are not present in dependencies.
# Add them to your bundle.

require "coverart"
require "faraday_middleware"
require "active_support"

client = Coverart::Client.new do |connection|
  connection.response :caching do
    ActiveSupport::Cache.lookup_store(:file_store, "./tmp/cache", namespace: "covertart", expires_in: 3600)
  end
end

Contributing

  1. Don't hesitate to submit your feature/idea/fix in issues
  2. Fork the repository
  3. Create your feature branch
  4. Ensure RSpec & Rubocop are passing
  5. Create a pull request

Tests & lint

bundle exec rspec
bundle exec rubocop

Both can be run with:

bundle exec rake

License & credits

Please see LICENSE for further details.

Contributors: ./graphs/contributors