|
|
This page documents the process of selecting & discriminating against album candidates
|
|
|
|
|
|
# Bootstrap
|
|
|
```mermaid
|
|
|
graph TB
|
|
|
entrypoint[A new track is added]-->check_album_name
|
|
|
check_album_name[Check its album name]-- If it's empty -->if_empty
|
|
|
check_album_name-- If a title is provided -->if_not_empty
|
|
|
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"]
|
|
|
|
|
|
```
|
|
|
|
|
|
subgraph Handle unknown albums
|
|
|
if_empty["Is there an album artist provided for this track?"]-- Yes -->use_album_artist_unknown_album["Use the
|
|
|
# Unknown album handling
|
|
|
```mermaid
|
|
|
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"]
|
|
|
end
|
|
|
```
|
|
|
|
|
|
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 main loop
|
|
|
```mermaid
|
|
|
graph TB
|
|
|
for_each[For each album candidate]-->check_new_track_album_artist
|
|
|
subgraph Main album selection loop
|
|
|
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?"] -->discard_candidate
|
|
|
check_new_track_album_artist-- No -->check_multi_disc
|
... | ... | @@ -30,12 +37,15 @@ subgraph Main album selection loop |
|
|
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 album candidate]-->for_each
|
|
|
accept_candidate[Accept this album candidate]-->for_each
|
|
|
end
|
|
|
discard_candidate[Discard this album candidate]
|
|
|
accept_candidate[Accept this album candidate]
|
|
|
```
|
|
|
|
|
|
for_each-->choose_candidate
|
|
|
choose_candidate["How many candidates are there left?"]-- 0 -->create_album["Create a new album"]
|
|
|
# Final album selection
|
|
|
```mermaid
|
|
|
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"]
|
|
|
choose_candidate-- 2+ -->select_first_candidate["Warn and select the 1st candidate"]
|
|
|
``` |
|
|
\ No newline at end of file |