This page documents the process of selecting & discriminating against album candidates
Bootstrap
graph TB
entrypoint[A new track is added]-->check_album_name
check_album_name{{Check its album name}}-- If empty -->unknown_albums["Handle unknown albums"]
check_album_name-- If provided -->if_not_empty
if_not_empty{{Is the new track in the same folder and with the same title as the previously analyzed track?}} -- Yes -->return_last_candidate[Return the previously selected album]
if_not_empty-- No -->get_candidates
get_candidates[Fetch all album with the same title]-->for_each["Album selection mainloop"]
Unknown album handling
graph TB
if_empty{{"Is there an album artist provided for this track?"}}-- Yes -->use_album_artist_unknown_album["Use the
album artist's unknown album"]
if_empty-- No -->check_track_artist_unknown_album
check_track_artist_unknown_album["Is there an artist provided for this track?"]-- Yes -->use_track_artist_unknown_album["Use the track artist's unknown album"]
check_track_artist_unknown_album-- No -->use_unknown["Use unknown artist's unknown album"]
Album selection main loop
graph TB
for_each[For each album candidate]-->check_new_track_album_artist
check_new_track_album_artist[Does the new track have an album artist]-- Yes --> compare_album_artist
compare_album_artist["Does the album artist differ from the candidate album?"]-- Yes -->discard_candidate
compare_album_artist-- No -->check_multi_disc
check_new_track_album_artist-- No -->check_multi_disc
check_multi_disc["Is the album tagged as multi disc?"] -- No -->check_different_folder
check_multi_disc -- Yes --> accept_candidate
check_different_folder["Is the new track in the same folder as the candidate album?"]-- Yes -->accept_candidate
check_different_folder-- No -->check_multi_artists
check_multi_artists["Are there multiple artists in the candidate album?"]-- No -->check_date
check_multi_artists-- Yes -->discard_candidate
check_date["Are all of the candidate album tracks released on the same date?"]-- Yes -->accept_candidate
check_date-- No -->discard_candidate
discard_candidate[Discard this candidate]
accept_candidate[Accept this candidate]
Final album selection
graph LR
candidate_list[Remaining candidates after filtering]-->choose_candidate
choose_candidate{{"How many candidates are there left?"}}-- 0 -->create_album["Create a new album"]
choose_candidate-- 1 -->select_candidate["Select that candidate"]
choose_candidate-- 2+ -->select_first_candidate["Warn and select the 1st candidate"]