mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
web: Fix a crash related to byte paths on Python 3
This commit is contained in:
parent
644cb86b24
commit
0833c82075
1 changed files with 5 additions and 2 deletions
|
|
@ -203,8 +203,11 @@ def all_items():
|
|||
@app.route('/item/<int:item_id>/file')
|
||||
def item_file(item_id):
|
||||
item = g.lib.get_item(item_id)
|
||||
response = flask.send_file(item.path, as_attachment=True,
|
||||
attachment_filename=os.path.basename(item.path))
|
||||
response = flask.send_file(
|
||||
util.py3_path(item.path),
|
||||
as_attachment=True,
|
||||
attachment_filename=os.path.basename(item.path),
|
||||
)
|
||||
response.headers['Content-Length'] = os.path.getsize(item.path)
|
||||
return response
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue