def wrapper(*args, **kwargs):
ans = func(*args, **kwargs)
if isinstance(ans, set):
- return {s.replace("'", r"\'") for s in ans}
- return ans.replace("'", r"\'")
+ return {s.replace("'", r"\'").replace('"', r'\"') for s in ans}
+ return ans.replace("'", r"\'").replace('"', r'\"')
return wrapper
# #### Search Methods #####
def _find_musicbrainz_artistid(self, artist):
"""Find MusicBrainzArtistID when possible.
- For artist with aliases having a mbid but not the main name, no mbid is
- fetched…
- Searching for Artist('Russian Circls') do not reslove the MBID
"""
if not self.use_mbid:
return None
mbids = None
for name in artist.names_sz:
- self.log.debug(name)
filt = f'((artist == "{name}") AND (MUSICBRAINZ_ARTISTID != ""))'
mbids = self.list('MUSICBRAINZ_ARTISTID', filt)
if mbids:
self.assertEqual(heavens_door.name_sz, target)
heavens_door = Artist(name=name)
self.assertEqual(heavens_door.name_sz, target)
+ # Same with double quote
+ name = 'Bonnie "Prince" Billy'
+ bonnie = Meta(name=name)
+ target = r"Bonnie \"Prince\" Billy"
+ self.assertEqual(bonnie.name_sz, target)
+ self.assertEqual(bonnie.name, name)
+
class TestArtistObject(unittest.TestCase):