Esempio n. 1
0
def titles_match(gm_title: str, sp_title: str) -> bool:
    stripped_gm_title, _ = utils.strip_ft_artist_from_title(gm_title)
    stripped_sp_title, _ = utils.strip_ft_artist_from_title(sp_title)
    stripped_gm_title = utils.strip_str(stripped_gm_title)
    stripped_sp_title = utils.strip_str(stripped_sp_title)
    logger.debug(
        f'Comparing gm_title "{stripped_gm_title}" to "{stripped_sp_title}"')
    return stripped_gm_title == stripped_sp_title
Esempio n. 2
0
 def test_strip_ft_artist_one_ft_no_brackets(self):
     """
     Given featuring one Artist not in brackets, should return stripped title and that one artist
     """
     title = 'Tha Lyot Remix feat. DJ Roy'
     expected = ('Tha Lyot Remix', 'DJ Roy')
     actual = utils.strip_ft_artist_from_title(title)
     self.assertEqual(actual, expected)
Esempio n. 3
0
 def test_strip_ft_artist_no_fts(self):
     """
     Should return the title as is with no featuring artists
     """
     title = 'Defeat'
     expected = (title, '')
     actual = utils.strip_ft_artist_from_title(title)
     self.assertEqual(actual, expected)
Esempio n. 4
0
 def test_strip_ft_artist_one_ft_hyphen(self):
     """
     Given featuring one Artist seperated by a hyphen instead of brackets
     Should return stripped title and that one artist
     """
     title = 'Stretch Deep - feat. Eve Essex'
     expected = ('Stretch Deep', 'Eve Essex')
     actual = utils.strip_ft_artist_from_title(title)
     self.assertEqual(actual, expected)
Esempio n. 5
0
 def test_strip_ft_artist_one_ft_no_dot(self):
     """
     Given featuring one Artist in brackets with no dot
     Should return stripped title and that one artist
     """
     title = 'MMXXX (ft Moor Mother)'
     expected = ('MMXXX', 'Moor Mother')
     actual = utils.strip_ft_artist_from_title(title)
     self.assertEqual(actual, expected)
Esempio n. 6
0
 def test_strip_ft_artist_one_ft_brackets_more_content(self):
     """
     Given featuring one Artist in brackets and more text after the Feat
     Should return stripped title and that one artist
     """
     title = 'WYWD (feat. Kelela) (Remix)'
     expected = ('WYWD (Remix)', 'Kelela')
     actual = utils.strip_ft_artist_from_title(title)
     self.assertEqual(actual, expected)
Esempio n. 7
0
def get_gm_track_artists(gm_track: gmusic.GMusicTrack) -> List[str]:
    artists = []
    if '&' in gm_track.artist:
        artists = [artist.strip() for artist in gm_track.artist.split('&')]
    else:
        artists.append(gm_track.artist)
    _, ft_artists = utils.strip_ft_artist_from_title(gm_track.title)
    if ft_artists:
        artists.append(ft_artists)
    return sorted(artists)
Esempio n. 8
0
    def test_strip_ft_artist_one_ft_brackets(self):
        """
        Given featuring one Artist in brackets, should return stripped title and that one artist
        """
        title = 'Jim Jones At Botany Bay (From "The Hateful Eight" Soundtrack)\
             (feat. Kurt Russell)'

        expected = (
            'Jim Jones At Botany Bay (From "The Hateful Eight" Soundtrack)',
            'Kurt Russell')
        actual = utils.strip_ft_artist_from_title(title)
        self.assertEqual(actual, expected)