Skip to content

Commit f2b6801

Browse files
authored
Merge pull request #2596 from aranc23/metasync-fixes
do not quote the value in xml, use quoteattr to add quotes as needed
2 parents 949d7fb + 8ba0060 commit f2b6801

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

beetsplug/metasync/amarok.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from os.path import basename
2222
from datetime import datetime
2323
from time import mktime
24-
from xml.sax.saxutils import escape
24+
from xml.sax.saxutils import quoteattr
2525

2626
from beets.util import displayable_path
2727
from beets.dbcore import types
@@ -51,7 +51,7 @@ class Amarok(MetaSource):
5151

5252
queryXML = u'<query version="1.0"> \
5353
<filters> \
54-
<and><include field="filename" value="%s" /></and> \
54+
<and><include field="filename" value=%s /></and> \
5555
</filters> \
5656
</query>'
5757

@@ -71,7 +71,9 @@ def sync_from_source(self, item):
7171
# for the patch relative to the mount point. But the full path is part
7272
# of the result set. So query for the filename and then try to match
7373
# the correct item from the results we get back
74-
results = self.collection.Query(self.queryXML % escape(basename(path)))
74+
results = self.collection.Query(
75+
self.queryXML % quoteattr(basename(path))
76+
)
7577
for result in results:
7678
if result['xesam:url'] != path:
7779
continue

0 commit comments

Comments
 (0)