From f36c70c754b7bd8c2616f0e37ff4853961deb991 Mon Sep 17 00:00:00 2001 From: Aran Cox Date: Thu, 15 Jun 2017 09:00:59 -0500 Subject: [PATCH 1/2] do not quote the value in xml, use quoteattr to add quotes as needed --- beetsplug/metasync/amarok.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beetsplug/metasync/amarok.py b/beetsplug/metasync/amarok.py index aaa1ee91e..caaea72dc 100644 --- a/beetsplug/metasync/amarok.py +++ b/beetsplug/metasync/amarok.py @@ -21,7 +21,7 @@ from __future__ import division, absolute_import, print_function from os.path import basename from datetime import datetime from time import mktime -from xml.sax.saxutils import escape +from xml.sax.saxutils import quoteattr from beets.util import displayable_path from beets.dbcore import types @@ -51,7 +51,7 @@ class Amarok(MetaSource): queryXML = u' \ \ - \ + \ \ ' @@ -71,7 +71,7 @@ class Amarok(MetaSource): # for the patch relative to the mount point. But the full path is part # of the result set. So query for the filename and then try to match # the correct item from the results we get back - results = self.collection.Query(self.queryXML % escape(basename(path))) + results = self.collection.Query(self.queryXML % quoteattr(basename(path))) for result in results: if result['xesam:url'] != path: continue From 8ba0060f4472a77d1368555b6f01f4a2152a3a9e Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 15 Jun 2017 20:46:54 -0400 Subject: [PATCH 2/2] Wrap a long line --- beetsplug/metasync/amarok.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beetsplug/metasync/amarok.py b/beetsplug/metasync/amarok.py index caaea72dc..0622fc17a 100644 --- a/beetsplug/metasync/amarok.py +++ b/beetsplug/metasync/amarok.py @@ -71,7 +71,9 @@ class Amarok(MetaSource): # for the patch relative to the mount point. But the full path is part # of the result set. So query for the filename and then try to match # the correct item from the results we get back - results = self.collection.Query(self.queryXML % quoteattr(basename(path))) + results = self.collection.Query( + self.queryXML % quoteattr(basename(path)) + ) for result in results: if result['xesam:url'] != path: continue