From 3b33705e3b65715379e0f9247bd7f03344b52a07 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 10 Apr 2013 14:21:47 +0200 Subject: [PATCH] Compute Content-Length to make tracks seekable in most players via the web plugin --- beetsplug/web/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beetsplug/web/__init__.py b/beetsplug/web/__init__.py index a61dae412..e5776412e 100644 --- a/beetsplug/web/__init__.py +++ b/beetsplug/web/__init__.py @@ -76,7 +76,9 @@ def all_items(): @app.route('/item//file') def item_file(item_id): item = g.lib.get_item(item_id) - return flask.send_file(item.path, as_attachment=True, attachment_filename=os.path.basename(item.path)) + response = flask.send_file(item.path, as_attachment=True, attachment_filename=os.path.basename(item.path)) + response.headers['Content-Length'] = os.path.getsize(item.path) + return response @app.route('/item/query/') def item_query(query):