Coder Social home page Coder Social logo

kleopatra999 / coverart_redirect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metabrainz/artwork-redirect

0.0 2.0 0.0 263 KB

URL redirect service for the coverartarchive.org

Home Page: https://coverartarchive.org

License: MIT License

Shell 0.88% Python 14.16% CSS 82.99% HTML 1.28% PLpgSQL 0.69%

coverart_redirect's Introduction

Cover Art Archive URL redirect service

This service will redirect from coverartarchive.org URLs to archive.org URLs, taking into account MBID redirects caused by release merges.

For example, this URL:

https://coverartarchive.org/release/5b07fe49-39a9-47a6-97b3-e5005992fb2a/front.jpg

should redirect to:

https://archive.org/download/mbid-5b07fe49-39a9-47a6-97b3-e5005992fb2a/mbid-5b07fe49-39a9-47a6-97b3-e5005992fb2a-2270157148.jpg

Development setup

There are two ways of setting up the server: with and without Docker. First option might be easier if you are just getting started. Second requires having a MusicBrainz database set up on your machine.

Option 1: Docker-based

Make sure that you have Docker and Compose installed. To start the development server and its dependencies run:

$ docker-compose -f docker/docker-compose.dev.yml up --build

After all Docker images start you should be able to access the web server at localhost:8080.

Note: Keep in mind that any changes that you make won't show up until the server container is recreated. To do that you can simply stop the server (Ctrl + C) and run the command above again.

Option 2: Manual

CAA redirect server works with Python 2, so make sure that you have it installed. Create a virtual environment, if necessary.

Install all required packages using pip:

$ pip install -r requirements.txt

Copy coverart_redirect.conf.dist to coverart_redirect.conf and adjust configuration values. You'd want to set up a connection to the instance of PostgreSQL with a MusicBrainz database that you should already have running.

Finally, run the coverart_redirect_server.py script to start the server.

All logging goes to stdout, including stacktraces, so its suitable for running inside of daemontools.

Testing

Currently some tests depend on an actual MusicBrainz database running in the background, so make sure to follow the setup process first. We use Pytest as a test runner. All tests can be run with the following command:

$ pytest

There are more ways to use Pytest (for example, to run only tests for a specific module). Check their documentation to see what kinds of additional options you have.

With Docker you can run all the tests like this:

$ docker-compose -f docker/docker-compose.test.yml up --build

You should see test results in the output.

coverart_redirect's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.