Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
(unsupported) Sinatra app working as an MPD client and the ability to vote for items
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
dumps
lib
models
public
script
spec
tmp
views
.gitignore
Gemfile
Gemfile.lock
Readme.rdoc
config.rb.example
config.ru
vote_your_album.rb

Readme.rdoc

Vote Your Album

This Sinatra application works as an MPD client. Besides the standard functionalities of an audio player, it gives the users the ability to vote for albums and influence the playlist.

Installation

  1. Clone this repository in a folder of your choice

  2. The application can be run with any ruby application server (e.g. Thin) or with Passenger.

    • To use a traditional server, just execute

      ruby vote_your_album.rb

    • To use Passenger, include this snippet within your apache configuration:

      <VirtualHost *:80>
        ServerName music.local
        DocumentRoot "<path to the application>/public"
        RackEnv development
        <directory "<path to the application>/public">
          Order allow,deny
          Allow from all
        </directory>
      </VirtualHost>
  3. Change the config file to suit your needs (See comments inside the config.rb file).

  4. Open a irb console and load the application:

    require 'vote_your_album'

    Then execute

    DataMapper.auto_migrate!

    to setup the database. The database has to be created before (i.e. in the mysql console)! If you want to setup a different database than development, just execute the respective DataMapper setup statement from the config.rb before running the migrations.

Loading the albums from the MPD library

To fill the albums database open irb again and load the application. Then connect to the MPD server (make sure that the configuration is correct in config.rb):

MpdProxy.setup('localhost', 6600)

If the connection was established you should see something like this:

OK MPD 0.11.5\n

You can then execute

Album.update

which will create new albums in the database (with associated songs) for all unknown albums on the MPD server. Already existing albums won't be changed.

Something went wrong with that request. Please try again.