Skip to content

Commit 01cf0d0

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 130c581 + 63692ff commit 01cf0d0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-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

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Fixes:
3030
:bug:`2583`
3131
* :doc:`/plugins/web`: Fix a crash on Windows under Python 2 when serving
3232
non-ASCII filenames. Thanks to :user:`robot3498712`. :bug:`2592` :bug:`2593`
33+
* :doc:`/plugins/metasync`: Fix a crash in the Amarok backend when filenames
34+
contain quotes. Thanks to :user:`aranc23`. :bug:`2595` :bug:`2596`
3335

3436

3537
1.4.4 (June 10, 2017)

0 commit comments

Comments
 (0)