MCPcopy Create free account
hub / github.com/jasperproject/jasper-client / get_soup_separated

Method get_soup_separated

client/modules/MPDControl.py:356–372  ·  view source on GitHub ↗

Returns the list of PHRASES that comprise song and artist titles

(self)

Source from the content-addressed store, hash-verified

354 return list(set(soup))
355
356 def get_soup_separated(self):
357 """
358 Returns the list of PHRASES that comprise song and artist titles
359 """
360
361 title_soup = [song.title for song in self.songs]
362 artist_soup = [song.artist for song in self.songs]
363
364 soup = list(set(title_soup + artist_soup))
365
366 title_trans = ''.join(chr(c) if chr(c).isupper() or chr(c).islower()
367 else '_' for c in range(256))
368 soup = [x.decode('utf-8').encode("ascii", "ignore").upper().translate(
369 title_trans).replace("_", " ") for x in soup]
370 soup = [re.sub(' +', ' ', x) for x in soup if x != ""]
371
372 return soup
373
374 def fuzzy_songs(self, query):
375 """

Callers

nothing calls this directly

Calls 1

translateMethod · 0.45

Tested by

no test coverage detected