diff --git a/beetsplug/web/__init__.py b/beetsplug/web/__init__.py index f49b550c6c..3ae8b1cddf 100644 --- a/beetsplug/web/__init__.py +++ b/beetsplug/web/__init__.py @@ -23,10 +23,10 @@ import flask from flask import g from werkzeug.routing import BaseConverter, PathConverter +from string import Template import os import json import tempfile -from string import Template import shlex import six import subprocess @@ -273,13 +273,13 @@ def item_converted_file(item_id): u' '.join(ui.decargs(args)), exc ) ) - attachment_filename = os.path.basename(util.py3_path(item.path)) - attachment_filename = attachment_filename[:attachment_filename.rfind('.')] + extension + attach_filename = os.path.basename(util.py3_path(item.path)) + attach_filename = attach_filename[:attach_filename.rfind('.')] + extension response = flask.send_file( util.py3_path(dest), as_attachment=True, - attachment_filename=attachment_filename, + attachment_filename=attach_filename, ) response.headers['Content-Length'] = os.path.getsize(dest) return response @@ -424,9 +424,11 @@ def func(lib, opts, args): app.config['INCLUDE_PATHS'] = self.config['include_paths'] if 'convert_extension' in self.config: - app.config['convert_extension'] = self.config['convert_extension'].as_str() + app.config['convert_extension'] = \ + self.config['convert_extension'].as_str() if 'convert_command' in self.config: - app.config['convert_command'] = self.config['convert_command'].as_str() + app.config['convert_command'] = \ + self.config['convert_command'].as_str() # Enable CORS if required. if self.config['cors']: