def setUp(self): self.song = Song("RAndom", "mr.Random", "the best of Random", "1:30") self.song1 = Song("Runaway", "Bon Jovi", "Greatest", "03:51") self.song2 = Song("In and out", "Bon Jovi", "Greatest", "04:26") self.test_list = [] self.test_list.append(self.song1) self.test_list.append(self.song2) self.play_list = Playlist("rrrr")
def generate_playlist(self): pl = Playlist(name="New_Generated_Playlist") for el in self.songs: album = MP3(self.path + "/" + el).tags["TALB"] artist = MP3(self.path + "/" + el).tags["TPE1"] title = MP3(self.path + "/" + el).tags["TIT2"] secs = MP3(self.path + "/" + el).info.pprint().split(", ")[-1] secs = self.format_length(int(secs.split(".")[0])) pl.add_song( Song(title=str(title), artist=str(artist), album=str(album), length=secs, path_to_file=self.path + "/" + el)) return pl
def setUp(self): self.pl1 = Playlist()