diff --git a/beetsplug/web/__init__.py b/beetsplug/web/__init__.py index 1bea628f8..2afef7786 100644 --- a/beetsplug/web/__init__.py +++ b/beetsplug/web/__init__.py @@ -25,6 +25,7 @@ from flask import g from werkzeug.routing import BaseConverter, PathConverter import os import json +import base64 # Utilities. @@ -44,7 +45,7 @@ def _rep(obj, expand=False): # Filter all bytes attributes and convert them to strings for key in filter(lambda key: isinstance(out[key], bytes), out): - out[key] = out[key].decode('utf-8') + out[key] = base64.b64encode(out[key]).decode('ascii') # Get the size (in bytes) of the backing file. This is useful # for the Tomahawk resolver API.