Semi-solved the box set problem

If you’ve ever imported a box set or multi disc/record release, you might have had this problem: beets not being able to find the release for you. If you import in --flat mode and send the ID manually, you can probably get it in. But we can automate it more. There doesn’t seem to be a way to query by medium title (ex. CD1 title = “Please Please Me”). Maybe MB can add that if we ask? Until then, you can search by medium count:

mediums = num_folders
query = artist + ' AND ' + 'mediums:' + mediums

Could try throwing the parent folder name in there too.

Looks like this is the code for detecting a multidisc album:

What if we did something like:

# we find a CD 1 and CD 2 folder, except they're named weird so the existing heuristic doesn't pick it up
# (very easy in box sets where people often tag them by the album they represent)
mediums = num_subfolders
name_from_tags = Quadrophenia
name_from_parent_folder = Quadrophenia 2010 Master
names = [name_from_tags, name_from_parent_folder]
old_score = 0
for name in names:
    query = artist + ' AND ' + 'mediums:' + mediums
    score = get_distance_score
    old_score = max(old_score, score)