mirror of
https://github.com/beetbox/beets.git
synced 2026-01-09 17:33:51 +01:00
Merge branch 'master' into euri10-master
This commit is contained in:
commit
6f977877fe
3 changed files with 14 additions and 2 deletions
|
|
@ -148,6 +148,8 @@ class MatchQuery(FieldQuery):
|
|||
|
||||
|
||||
class NoneQuery(FieldQuery):
|
||||
"""A query that checks whether a field is null."""
|
||||
|
||||
def __init__(self, field, fast=True):
|
||||
super(NoneQuery, self).__init__(field, None, fast)
|
||||
|
||||
|
|
|
|||
|
|
@ -217,12 +217,20 @@ def all_items():
|
|||
@app.route('/item/<int:item_id>/file')
|
||||
def item_file(item_id):
|
||||
item = g.lib.get_item(item_id)
|
||||
|
||||
# On Windows under Python 2, Flask wants a Unicode path. On Python 3, it
|
||||
# *always* wants a Unicode path.
|
||||
if os.name == 'nt':
|
||||
item_path = util.syspath(item.path)
|
||||
else:
|
||||
item_path = util.py3_path(item.path)
|
||||
|
||||
response = flask.send_file(
|
||||
util.py3_path(item.path),
|
||||
item_path,
|
||||
as_attachment=True,
|
||||
attachment_filename=os.path.basename(util.py3_path(item.path)),
|
||||
)
|
||||
response.headers['Content-Length'] = os.path.getsize(item.path)
|
||||
response.headers['Content-Length'] = os.path.getsize(item_path)
|
||||
return response
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ Fixes:
|
|||
* :doc:`/plugins/lastgenre`: Fix a crash when using the `prefer_specific` and
|
||||
`canonical` options together. Thanks to :user:`yacoob`. :bug:`2459`
|
||||
:bug:`2583`
|
||||
* :doc:`/plugins/web`: Fix a crash on Windows under Python 2 when serving
|
||||
non-ASCII filenames. Thanks to :user:`robot3498712`. :bug:`2592` :bug:`2593`
|
||||
|
||||
|
||||
1.4.4 (June 10, 2017)
|
||||
|
|
|
|||
Loading…
Reference in a new issue