okjuan / music-lib-bot

Because I like discovering music but I'm too lazy to drag and drop
MIT License
3 stars 0 forks source link

`playlist_updater`: Find Albums Individually Instead of Creating Groups #15

Open okjuan opened 3 years ago

okjuan commented 3 years ago

Shouldn't be calling get_my_albums_grouped_by_genre. Should look at albums individually instead

    def _get_my_matching_albums(self, genres, num_albums_to_fetch, genre_matching_criteria):
        album_groups = self.my_music_lib.get_my_albums_grouped_by_genre(
            num_albums_to_fetch, len(genres))
        for group in album_groups:
            if genre_matching_criteria(genres, group['genres']):
                print(f"Good news! I found {len(group['albums'])} album(s) matching your playlist's genres:")
                print(self.music_util.get_albums_as_readable_list(group['albums']))
                return group['albums']
        print("Sorry, I couldn't find any albums matching your playlist's genres :(")
        return []
okjuan commented 2 years ago

This problem is deceptively complex..

okjuan commented 2 years ago

But this is an example of why the current solution is not good:

> What's the name of your playlist?
80s mom rock
Your playlist's most common genres are: album rock

> # of albums to fetch from your library? default is 50
150
Grouping 160 albums...

Instead of grouping albums, the program should just look through each album in the library that has the genre "album rock".