/item/at_path/ endpoint

More at_path

/item/by_path docs
This commit is contained in:
Steve Johnson 2017-01-14 00:12:07 -08:00
parent 29d61ca634
commit 43936cd84c
2 changed files with 15 additions and 0 deletions

View file

@ -221,6 +221,14 @@ def item_query(queries):
return g.lib.items(queries)
@app.route('/item/at_path/<path:path>')
def item_at_path(path):
try:
return flask.jsonify(_rep(beets.library.Item.from_path('/' + path)))
except beets.library.ReadError:
return flask.abort(404)
@app.route('/item/values/<string:key>')
def item_unique_field_values(key):
sort_key = flask.request.args.get('sort_key', key)

View file

@ -162,6 +162,13 @@ response includes all the items requested. If a track is not found it is silentl
dropped from the response.
``GET /item/by_path/...``
+++++++++++++++++++++
Look for an item at the given path on the server. If it corresponds to a track,
return the track in the same format as /item/*.
``GET /item/query/querystring``
+++++++++++++++++++++++++++++++