Giter Site home page Giter Site logo

musiccollection's Introduction

Music Collection

A locally stored and run browser application for recording, logging, and rating your music collection.

Integrates with Spotify API to access a vast database of album, artist, and track information to fill out the details of your personal music collection.

Features the ability for the user to compare two albums under a dozen different categories which ideally define the best albums. Through these pairwise comparisons, scores are assigned to each album and a ranking is computed.

Installation

This application relies on five unique things, all which must be set up for it to run. Here is one way you may set everything up, in the order for which I believe you'll run into problems first. The work here has been developed on a unix Mac; issues may arise with other platforms. Feel free to post an issue/email me if you have problems getting set up.

1. MongoDB

Visit the PyMongo documentation. To get PyMongo going (discussed later), you'll first need MongoDB community edition itself. There's a link on the page for that, but I installed with brew.

We will need to update the mongodb path in package.json, and that is clarified later.

2. Repository

Clone this repository: git clone [email protected]:liebscher/MusicCollection.git.

cd into the new directory.

2. Node

Install the latest Node and npm (already distributed with Node).

Run npm install to install the package dependencies from package-lock.json in the local node_modules directory.

3. Python

Ensure you have Python3 installed (using Anaconda should be ok).

Create a virtual environment:

  1. If you don't already have virtualenv, run: python3 -m pip install --user virtualenv
  2. python3 -m venv mc
  3. source mc/bin/activate

Lastly, we'll install all the necessary packages, run: pip install -r requirements.txt

4. Spotify API Integration

Visit the Spotify Developer page and log into you/sign up for an account. Select "Create a Client ID". Create an ID for a Website application (I used the unoriginal name "MusicCollection"). Navigate to your new client application dashboard. Copy both your new Client ID and Client Secret into the config.py file located in the home directory. Keep them in quotes.

This API is how the application fetches new albums and track lists and everything.

5. Launch

Lastly, you'll want to launch the application. Run npm run launch. A browser window should open and the application should begin loading. If you you've added albums and they don't load, refresh the page.

musiccollection's People

Contributors

liebscher avatar

Stargazers

Federico Madden avatar

Watchers

James Cloos avatar  avatar

musiccollection's Issues

Fetch track musical data

Utilize the Spotify API to also fetch data about each track regarding the musical qualities of them. Would require retroactively filling in missing data.

Update comparison choice heuristic

The algorithm should choose a category, then pick the two feasible albums which have the smallest difference in scores for that category. Perhaps a random pairing every so often (~5?). Also, category choice should be the category with the fewest comparisons, perhaps with the occasional random choice in there (~3?).

Beautify the Stats section

Overhaul the charts with new colors, labels, grids, proper spacing, proper ticks, etc.

  • New color scheme
  • Add interaction tooltips
  • Clean up awkward tiling & text position

Sort by Scores

Create functionality to sort the filtered collection by score, both ascending and descending. Should have an option to choose the category to sort by, including an overall/average score.

  • Re-implement view of all scores with a better UI
  • Create a filter view to select category to sort by
  • (optional) Iconography for top/bottom 3 albums

Move Spotify credentials to git-ignored config file

Just reset my existing Spotify API client secret to invalidate it. Nice try hackerz (probably should have setup a private config file earlier but didn't expect this repo to become public).

Have app.py access this new config file to retrieve the Spotify API ID and secret. Upload a blank version for easy customization, but then add the file to .gitignore.

Create Statistics section

Would like to be able to view some statistics on the collection.

  • Quick jump to and from the section and the top of page.
  • Bar graphs / counts for genres (since genres are from artists, limit to unique artists)
  • Histogram of release years
  • Histogram of runtimes
  • Stats on comparisons (total #, # of albums without comparisons, most controversial album (variance in scores))

Smooth out comparison heuristic

The same comparison may be asked twice in a row, which isn't ideal.

Perhaps create a queue and just draw from the queue, instead of calculating each on the fly. Would allow for finer control over category selection and randomness and prevent duplicate comparisons.

Change "controversial" section to be out of 100

Update the controversial to represent a portion of the theoretically maximum score. With N=12 and sqrt(N / (4N-4)) as the maximum standard deviation (half 1's, half 0's), then out of 0.5222.

Perhaps add progress bars too.

Refresh scores every N comparisons

Instead of scores only fetching every render of the app (basically, on page refresh), have them update every N comparisons, where N=10 or so.

Add genre into recommended score

Calculate genres rarity score for each album. Use this in the recommended score to recommend albums with less commonly listened to genres.

Edge case: albums without specified genres

Convert Action strings to constants

Some actions are currently represented by plain strings. These should be converted to constants, added appropriately in the /constants directory.

Add Documentation for Backend

Add documentation for Flask backend. Both inline and function comments.

Add tests for:

  • add_album()
  • edit_album_review()
  • add_album_category()
  • delete_album_category()
  • update_track_review()
  • add_album_listen()
  • delete_album()

Update Recommended sort

Things to take into account: last listen, add date, number of listens, and runtime.

We want to recommend albums that haven't been listened to in a while, were added a while back, have little time between add and listen, and are at one listen.

Create a recommended score:

Last listen: 0-1 (1: least recent)
Add date: 0-1 (1: least recent)
Runtime: 0-1 (1: shortest)
Num. of listens: 0-1 (manually set weights)

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.