Code Monkey home page Code Monkey logo

pload's Introduction

Pload

Pload is a web-based playlist loader for johnny-six.

It integrates a playlist builder with search using ElasticSearch. Users select a time range for their show, what johnny-six queue they want to play from, and what DJ they want johnny-six to log as. They then build or upload a playlist, using tracks from the search or direct URLs as they see fit.

To retrieve tracks, Johnny-Six polls the API, which returns the next unplayed track in the current show slot, marking it as played.

Local Development

  1. Copy config/config_example.json to config/config.json.
  2. Generate a random SECRET_KEY for config.json.
  3. Run docker-compose up
  4. On first run, run docker exec -it pload_app_1 flask initdb to create the necessary database tables.

pload's People

Contributors

dependabot[bot] avatar echarlie avatar mutantmonkey avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

elgohr-update

pload's Issues

RFE: better ACL/Authz

currently, we just limit any access to a group. in the future, we may want users to be able to only edit their own playlists. a "traffic admin" user might be able to edit any non-prerecorded playlist, "traffic-staff" can only create non-prerecorded, "librarians" can create and edit anything, and "fmdjs" can create any playlist.

URL translation

because of our split view dns, web proxies, and other stuff, we need a way to translate "internal" names to "external" names. this isn't just a matter of chaning the hostname; it may also include changing protocol or path. we need a sophisticated way to do this.

RFE: "approximate start time"

add a toggle to allow DJ to view "approximate start time" instead of "offset" for tracks. This would be a huge boon for half-hour-offset shows (daytime new music slots, mostly).

Consider Reliscensing?

Currently Pload is liscensed under a 3-clause BSD liscence. Ignoring my personal distaste for it (I think ISC is better suited for those intentions), pload has grown beyond its' original scope. Should we reliscense under AGPL-3 or MPL-2, to be more consistent with other projects?

Add option to quickly/easily display audio URL for tracks in a given playlist

Currently in the playlist editor, you have to click the "View track information" button to get the URL of the audio file that's going to be played. It'd be neat if there were an option to display this somewhere near the track without having to click that button (I was thinking just an extra "row" of space where the URL would go, but mm suggested a tooltip/mouseover, which might be nicer).

This would make it easier to check that a playlist is sorted (e.g. Doncasts where all of his audio is 01, 02, 03... .mp3) without having to perform a bunch of extra mouse clicks.

On the playlist view, the "played" column isn't entirely accurate

When viewing a playlist that has at least one track marked as played in the database, there a different view is displayed that shows a URL and a "played" column. This "played" column is not really accurate; it means that a track has been queued by Liquidsoap but not necessarily played. We should use different language here.

Cannot drag track to top of playlist

dragging only allows appending, so a track cannot be moved to the first position: instead, one must drag it to the second position and move the track in the first position. It's not clear why to the user.

playlist editor dense mode

the playlist editor is hard to use because it is not dense. we should either make it more dense, or make a checkbox to set the density to high.

cannot edit playlist while updating elasticsearch

because we toss the entire elasticsearch index and replace it to update, it's effectively not possible to create or edit playlists when replacing records. we should figure out how to make updates faster or less disruptive.

Implement Elasticsearch integration

For playlist creation, we've decided to use elasticsearch. The exact formats of records will change over time, but will include basic metadata, album, artist, and label.

  • search elasticsearch with query language
  • use record to add track to playlist
  • use basic auth for elasticsearch interface; proxy user queries

lockout "add track" button while working

it's very easy to get confused by the add track modal if it takes time. either poping up a rotating icon, clearing the field, and allowing the user to add another track, or just locking out the "add track" button will make it harder to accidentally add tracks multiple times

report size of search result set

the search api only shows the first 10 results. we should say "showing 10 of XXX" (which is reported by the API), and remind users to refine their queries.

Half of the time, import-songs fails

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.8/http/client.py", line 1332, in getresponse
    response.begin()
  File "/usr/local/lib/python3.8/http/client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.8/http/client.py", line 264, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/elasticsearch/connection/http_urllib3.py", line 232, in perform_request
    response = self.pool.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 640, in urlopen
    retries = retries.increment(method, url, error=e, _pool=self,
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 344, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.8/site-packages/urllib3/packages/six.py", line 686, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    httplib_response = self._make_request(conn, method, url,
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 389, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='elasticsearch.default.svc.cluster.local', port=9200): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 966, in main
    cli.main(prog_name="python -m flask" if as_module else None)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 426, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/src/app/pload/app.py", line 129, in import_songs
    es.delete_by_query(dest_index, body={"query": {"match_all": {},},})
  File "/usr/local/lib/python3.8/site-packages/elasticsearch/client/utils.py", line 139, in _wrapped
    return func(*args, params=params, headers=headers, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/elasticsearch/client/__init__.py", line 691, in delete_by_query
    return self.transport.perform_request(
  File "/usr/local/lib/python3.8/site-packages/elasticsearch/transport.py", line 345, in perform_request
    status, headers_response, data = connection.perform_request(
  File "/usr/local/lib/python3.8/site-packages/elasticsearch/connection/http_urllib3.py", line 244, in perform_request
    raise ConnectionTimeout("TIMEOUT", str(e), e)
elasticsearch.exceptions.ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host='elasticsearch.default.svc.cluster.local', port=9200): Read timed out. (read timeout=10))
command terminated with exit code 1

RFE: "file browser" search

Sometimes I know I want a track by a specific artist, but either don't know what albums we have or don't know what tracks are on an album. So we should implement a pseudo-file-browser view where I search for artist, and can see album groupings.

Open questions: should we have an index generated from elasticsearch to create this view? Should this be a toggle on the search card or a seperate tab?

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.