Skip to content
A web music player built with Flask and Backbone.js emulating Foobar2k
JavaScript CSS HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
backbone.js
beets.css
beets.js
favicon.ico
index.html
jquery.js
underscore.js

README.md

bonebox notes

A fork of the beets web plugin meant to emulate foobar2k but on the web.

notes

Need to figure out how the files in the beets web code are actually ran.

It's in __init__.py in the web directory.

Simply calling ./beet web 0.0.0.0 8888 from the repository will include changes in the code. So, I can get started with development before figuring out how to make it work independently from beets.

I got this far:

>>> import beetsplug
>>> from beetsplug import web
>>> web
>>> from beetsplug.web import WebPlugin
>>> wp = WebPlugin()
>>> wp.commands()[0].func()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: func() takes exactly 3 arguments (0 given)

Those 3 arguments are lib, opts, args where lib is a beets library, and opts and args are suboptions and subarguments to the command line choice.

A key step in isolating the web plugin will be replacing the invocation with my own python script. But first, I will first need to remove all references to those parameters are their consumers from the web app.

I'm considering getting rid of beets web completely in favor of Clojure stack + Backbone. I did this, it went pretty well.

todo

  • implement /item/query/ response with files from disk
  • consider the future including Zoia
  • get app to play music from filesystem
  • work on UI or work on API

api

Currently the beets web API comprises these models:

  • items (files)
  • albums
  • artists
  • stats

Additionally, there are one or more routes for each model which include queries on the models.

Which of these models/routes are actually used by the front end? Just these routes:

  • item/query/
  • item/id/file

The front end merely sends a query to beets and outputs the response as a list of tracks. However, because it's coming from beets, there's tons of awesome metadata. We don't need all of it in order to play music. The minimal set of metadata items appears to be as follows:

beets model(s)

Models in beets web:

ItemEntryView

  • Title

ItemDetailView

  • Artist
  • Album
  • Year

ItemExtraDetailView

  • track (number)
  • track total
  • disc (number)
  • disc (total)
  • length
  • format
  • bitrate
  • mb_trackid (musicbrainz entry)
  • id (used for download: href=item/<%= id %>/file)
  • lyrics
  • comments

bonebox models

In order to properly emulate foobar, we'll need most of the fields in ItemExtraDetail view.

software architecture

In Zoia:

  • routes corresponding to resources
  • functions to retrieve those resources
  • possibly data transformations in between retrieval and response
You can’t perform that action at this time.