Spinna

I have a lot of music. This little application helps me make sure that I don’t always listen to the same stuff because I seem to be really bad at randomizing my album selection.

Spinna will simply select some random albums from a given location and copy them to my current working directory. It will also keep track of the selections made in order to improve the rotation by not allowing a recently selected album to be selected again.

Spinna works great if your music collection is organized as a music directory containing a flat structure of directories where each directory is an album. It’s also helpful if the album folder names follow a proper naming scheme. I use <ARTIST NAME> - <YEAR> - <ALBUM TITLE> which allows me to filter albums on artist name or album year.

Requirements

Spinna requires Ruby 1.9+.

Installation

gem install spinna

Configuration

First, spinna needs to be configured. Create a folder named .spinna in your home directory and create a file named config.yml. If you run spinna before creating the folder in your home directory, it will be created but you will have to create the config file yourself.

The configuration file should look like this:

source_dir: '/foo'
history_size: 50
number_of_picks: 10

The source_dir represents the location of your music library on your filesystem. It is assumed that this directory contains a flat hierarchy of folders, your albums. It is required.

The history_size is how many picks do we keep in the history log before we start removing the older picks. If you do not supply it, the default value is 50.

The number_of_picks represents the default number of album picks you want Spinna to make when you run it. If you do not supply it, the default value is 10.

Usage

To run, simply do:

spinna get

and it will download the default number of picks in the current working directory.

You can also request a given number of picks if you want:

spinna get -n 10

and it will pick 10 albums from your music library and download them in the current working directory.

You can also pass in a pattern to only pick from matching albums. The following would pick 10 albums from the albums that contain the string "2014".

spinna get -n 10 -p 2014

Tests

To run the test, run bundle exec rake.

Contributing

  1. Fork it ( https://github.com/hydrozen/spinna/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request