Merge pull request #132 from loidy/87-libraries-with-apostrophes

Fix libraries sync when jellyfin library has apostrophes in name
This commit is contained in:
mcarlton00 2019-11-04 09:54:45 -05:00 committed by GitHub
commit 05875b507f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -293,7 +293,11 @@ def indent(elem, level=0):
def write_xml(content, file):
with open(file, 'w') as infile:
content = content.replace("'", '"')
# replace apostrophes with double quotes only in xml keys, not texts
def replace_apostrophes(match):
return match.group(0).replace("'", '"')
content = re.sub("<(.*?)>", replace_apostrophes, content)
content = content.replace('?>', ' standalone="yes" ?>', 1)
infile.write(content)