From 5bc720fd4c39ee36d6aa4a0eac299af136b41fdc Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 16 Apr 2012 15:11:05 -0400 Subject: [PATCH] CC-3657: Watch Folders -> mp3 files could not be loaded -fixed --- .../media-monitor/airtimefilemonitor/mediamonitorcommon.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py b/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py index 2852cec45..4563915a8 100644 --- a/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py +++ b/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py @@ -298,7 +298,12 @@ def test_file_playability(pathname): """ liquidsoap_found = subprocess.call("which liquidsoap", shell=True) if liquidsoap_found == 0: - return_code = subprocess.call("liquidsoap -r \"%s\"" % pathname.replace('"', '\\"'), shell=True) + #return_code = subprocess.call("liquidsoap -r \"%s\"" % pathname.replace('"', '\\"'), shell=True) + + #when there is an single apostrophe inside of a string quoted by apostrophes, we can only escape it by replace that apostrophe + #with '\''. This breaks the string into two, and inserts an escaped single quote in between them. + command = "liquidsoap -c 'output.dummy(single(\"%s\"))'" % pathname.replace("'", "'\\''") + return_code = subprocess.call(command, shell=True) else: return_code = 0