Commit graph

126 commits

Author SHA1 Message Date
Max Ammann
041adf47ac Fixed lines which are mor than 79 characters 2016-06-26 19:53:57 +02:00
Max Ammann
5831b99b9f Adding 'expand' flag for json requests
This allows you to query the individual items of an album
2016-06-26 19:53:57 +02:00
Adrian Sampson
5efd5b21c5 Use new as_str method
Instead of `get(six.text_type)`, which was a surprisingly large portion of our
uses of six.
2016-06-25 19:16:14 -07:00
Johnny Robeson
e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Johnny Robeson
94bab42f97 use strings (not bytes) for flask responder names 2016-05-30 21:19:15 -04:00
Adrian Sampson
59435792e9 Merge pull request #2010 from sumpfralle/web-api-unique-results
web: add API functions for retrieving unique values of specific keys
2016-05-27 00:15:34 -07:00
Lars Kruse
d50923553d web: add API functions for retrieving unique values of specific keys
the following API paths are added:
* /item/values/FIELD
* /album/values/FIELD

Both paths will deliver a json dictionary with the key 'values' containing a
list of unique values belonging to the requested table and field.
Sorting is possible by supplying the query argument "sort_key".

This feature is useful for remote clients, e.g. Mopidy-Beets:
* track genres: /item/unique/genre
* track languages: /album/unique/language
* album artists: /album/unique/albumartist?sort_key=albumartist_sort
* album years: /album/unique/year
2016-05-27 04:12:09 +02:00
Lars Kruse
be4dc227fc web: handle missing art gracefully 2016-05-24 03:05:51 +02:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
c2e7d59db7 Removed import of unicode_literals from plugin web 2016-02-20 14:36:56 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Old T. Man
acd0a902bb Fix search term encoding. 2015-05-23 13:19:28 -06:00
Adrian Sampson
b8dab9cf9f Merge pull request #1247 from brunal/future
Use all __future__ imports in beets core

Conflicts:
	beetsplug/web/__init__.py
	test/test_embedart.py
2015-01-26 17:02:07 -08:00
Andre Miller
96e3d8b451 Replaced print with log.info 2015-01-21 19:31:02 +02:00
Bruno Cauet
545ba22f94 CORS init in web plugin: print → log 2015-01-21 10:18:13 +01:00
Bruno Cauet
c2f8cb9983 Merge branch 'master' into future
Conflicts:
	test/test_plugins.py
2015-01-21 10:04:33 +01:00
Andre Miller
f815138758 Combined cors and cors_origin config options into one 2015-01-20 19:53:04 +02:00
Bruno Cauet
a5026100a3 All plugins use unicode_literals
Given that part of them has no test I may have broke them
2015-01-20 16:22:27 +01:00
Andre Miller
47ea4b7d8b flake8 formatting updates 2015-01-20 16:06:16 +02:00
Andre Miller
f47be23658 CORS support now uses flask-cor extension 2015-01-20 15:33:33 +02:00
Andre Miller
c8880de52c Fixes for flake8 validation 2015-01-20 00:38:26 +02:00
Andre Miller
bd63e1e386 Made CORS configurable and changed host default to 127.0.0.1 2015-01-20 00:20:26 +02:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Andre Miller
9fe2bc1a38 Support for CORS 2015-01-18 10:23:49 +02:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Adrian Sampson
4f3cd65943 Fix #1045: whitespace-separated queries in web 2014-10-27 23:14:28 -07:00
udiboy1209
ac7646f0f4 Fix alignment of play button with logo 2014-05-11 19:21:50 +05:30
udiboy1209
07b791dbd3 improve detail display and scrollbar in web plugin
Moved track, format, lyrics, etc. to separate div with id 'extra-detail'
so that theses can scroll independent of the main details(Title, Album, Artist).
Split the templates and javascript rendering objects accordingly.

This has a better scrollbar display than the previous commit.
2014-05-03 21:08:07 +05:30
udiboy1209
35eb60c393 More elegant fix to line break display problem for lyrics in web plugin
The javascript `replace` method was previously being used, which worked in a hacky way.
But the more elegant way to do it, as suggested by minitech on this question http://stackoverflow.com/questions/23440298 ,
is to use CSS, and make the browser automatically display white-spaces using `white-space: pre-wrap`
2014-05-03 10:31:02 +05:30
udiboy1209
756f4c4d29 Fix web plugin scroll and lyrics newline bug 2014-05-02 20:54:57 +05:30
Adrian Sampson
e5a9db1cac fix up some indentation warnings in plugins 2014-04-13 17:55:49 -07:00
Fabrice Laporte
3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00
Adrian Sampson
472571a4c6 web: fix typo in albums endpoint 2014-02-26 20:08:22 -08:00
Thomas Scholtes
004e9a8144 Add query converter 2014-02-10 17:26:26 +01:00
Thomas Scholtes
dcbf7ecc36 Fix album retrieval 2014-02-10 17:26:26 +01:00
Thomas Scholtes
6663ed0c64 Use URL converters 2014-02-10 17:26:26 +01:00
Thomas Scholtes
75c3b82d88 Test and fix web /item/query/<query> 2014-02-02 19:12:10 +01:00
Thomas Scholtes
f706e58409 Web API handles multiple ids 2014-02-02 19:04:04 +01:00
Thomas Scholtes
f98240b83c JSON API responds with embedded items
This effectively removes the "album_ids" and "item_ids" keys from the responses
of `/item/` and `/album/`, respectively. Instead there are "albums" and "items" keys,
respectively that contain a list of JSON representations for all albums and
items.
2014-01-21 22:40:42 +01:00
Thomas Scholtes
9d1731faf2 Use generators to stream web requests 2014-01-21 16:42:25 +01:00
Thomas Scholtes
7d6d8f1fd4 Embed item data into web request 2014-01-21 16:08:22 +01:00
Adrian Sampson
fa97684e7b fix outdated _record reference in web plugin 2013-09-09 20:56:38 -07:00
Adrian Sampson
6677cea036 fix uses of item.dirty and item.record 2013-08-21 10:57:52 -07:00
Adrian Sampson
1649512b54 web: item_count -> stats (#333)
The new /stats endpoint now counts both items and albums. In the future, it
could also expose other interesting information.
2013-06-21 10:27:49 -07:00
Uwe L. Korn
3fd78bd63d [web] Add API method to get the total item count 2013-06-21 16:01:03 +02:00
Adrian Sampson
8ae202cf24 changelog for #246 2013-04-10 10:18:58 -07:00
Uwe L. Korn
3b33705e3b Compute Content-Length to make tracks seekable in most players via the web plugin 2013-04-10 14:21:47 +02:00
Adrian Sampson
70b528ed81 use standard query API for album-by-artist (#240) 2013-04-02 20:31:28 -07:00
Uwe L. Korn
dcc1e1aa71 Add functions needed for ScriptCollection Support in Tomahawk 2013-04-01 17:50:51 +02:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
6d68a4855e per-plugin configuration defaults in __init__()
This uses the new BeetsPlugin.config convenience view heavily. Things are
slowly getting less verbose.
2012-12-18 22:35:44 -08:00
Adrian Sampson
3ef9e006f4 finish confit-ifying all the plugins 2012-12-13 17:14:19 -08:00
Zach Denton
6c6ae5a7c0 Send correct filename when downloading a file. 2012-08-26 15:19:03 -04:00
Adrian Sampson
473fe04f91 web: add size to item JSON in API
This is to be used by the Tomahawk resolver, which wants file sizes.
2012-08-24 19:20:27 -07:00
Adrian Sampson
00c47b6811 library has per-thread transaction stacks (GC-399)
The Library object is now (almost) safe to share across threads. Per-thread
resources are now automatically managed internally. There is no longer any need
for the _reopen_lib hack to get multiple copies of the Library object.
2012-06-08 11:09:45 -07:00
Adrian Sampson
d88afbad11 library maintains per-thread DB conns. (GC-399) 2012-06-08 10:49:47 -07:00
Adrian Sampson
b68e87b92c The Great Trailing Whitespace Purge of 2012
What can I say? I used to use TextMate!
2012-05-13 20:22:17 -07:00
Adrian Sampson
a28f930c52 transaction objects to control DB access
In an attempt to finally address the longstanding SQLite locking issues, I'm
introducing a way to explicitly, lexically scope transactions. The Transaction
class is a context manager that always fully fetches after SELECTs and
automatically commits on exit. No direct access to the library is allowed, so
all changes will eventually be committed and all queries will be completed. This
will also provide a debugging mechanism to show where concurrent transactions
are beginning and ending.

To support composition (transaction reentrancy), an internal, per-Library stack
of transactions is maintained. Commits only happen when the outermost
transaction exits. This means that, while it's possible to introduce atomicity
bugs by invoking Library methods outside of a transaction, you can conveniently
call them *without* a currently-active transaction to get a single atomic
action.

Note that this "transaction stack" concepts assumes a single Library object per
thread. Because we need to duplicate Library objects for concurrent access due
to sqlite3 limitation already, this is fine for now. Later, the interface should
provide one transaction stack per thread for shared Library objects.
2012-05-06 23:24:05 -07:00
Adrian Sampson
6f5beff8e0 use non-minified JavaScript libraries (#259) 2011-11-23 18:26:08 -08:00
Adrian Sampson
f48fefdf61 merge 2011-09-18 15:39:38 -07:00
Adrian Sampson
521131bc2b screenshot image and syntax cleanup 2011-09-17 15:32:27 -07:00
Adrian Sampson
9348c6a2b8 port and host options for web plugin 2011-09-16 12:00:05 -07:00
Adrian Sampson
05aa907e23 move player to the left 2011-08-08 18:41:25 -07:00
Adrian Sampson
4dc020e4a7 show a few more file details 2011-08-08 16:38:02 -07:00
Adrian Sampson
8e0638512d automatically play next track 2011-08-08 16:27:28 -07:00
Adrian Sampson
7a28dcecb0 player improvements: double-click to play; visual indicator 2011-08-08 16:19:22 -07:00
Adrian Sampson
b6ac0e4d36 replace audio.js with a hand-rolled player 2011-08-08 15:11:49 -07:00
Adrian Sampson
952dbad142 in-page media player using audio.js 2011-08-07 10:30:44 -07:00
Adrian Sampson
ba45cf6964 show more detail about items 2011-08-07 01:08:08 -07:00
Adrian Sampson
e06f3247fd UI tweaks 2011-08-07 00:42:24 -07:00
Adrian Sampson
586371a4e2 show detail for selected item 2011-08-07 00:30:57 -07:00
Adrian Sampson
e8baeb0c07 a little style for the web interface 2011-08-06 23:56:40 -07:00
Adrian Sampson
568683af21 basic Backbone.js-based frontend 2011-08-06 11:20:17 -07:00
Adrian Sampson
8493909a81 albums and queries in web plugin 2011-08-06 09:52:22 -07:00
Adrian Sampson
c11c7fe4cc playing around with a Web API 2011-08-05 17:35:47 -07:00