<html><center><p>Start</p></center>
<center><p><tt>__main__.py</tt></p></center></html>
<html><center><p>Call CLI</p></center>
<center><p><tt>ui.__init__.py main() -> _raw_main()</tt></p></center></html>
<html><center><p>Bootstrap</p></center>
<center><p><tt>ui.__init__.py _setup()</tt></p></center></html>
Folder 1
<html><center><p>Configure Musicbrainz API</p></center>
<center><p><tt>autotag.mb.py configure()</tt></p></center></html>
<html><center><p>Configure</p></center>
<center><p><tt>_configure()</tt></p></center></html>
<html><center><p>Load plugins</p></center>
<center><p><tt>_load_plugins()</tt></p></center></html>
Add types and queries defined by plugin
Send 'pluginload' event
Get default subcommands
Load plugin subcommands
<html><center><p>Open library</p></center>
<center><p><tt>_open_library()</tt></p></center></html>
Check if library exists
Continue
<html><center><p>Parse subcommand and arguments</p></center>
<center><p><tt>ut.__init__.py _raw_main() -></center>
<center>SubcommandsOptionParser.parse_subcommand()</tt></p></center><html
Run subcommand function
Assume 'import' command
<html><center><p>Set importer configuration</p></center>
<center><p><tt>ui.commands.py import_func()</tt></p></center></html>
Check user-supplied directories
<html><center><p>Import files</p></center>
<center><p><tt>ui.commands.py import_files()</tt></p></center></html>
<html><center><p>Create import session</p></center>
<center><p><tt>ui.commands.TerminalImportSession</tt></p></center></html>
<html><center><p>Run session</p></center>
<center><p><tt>TerminalImportSession.run()</tt></p></center></html>
Folder 2
Split directory tasks into a task for each album
Add stages for import
Add plugin early import stages
Add plugin import stages
Send 'import_begin' event to plugins
Check if threading enabled
Run pipeline sequentially
Run pipeline in parallel threads
Check if autotag enabled
<html><center><p>Find candidates</p></center>
<center><p><tt>importer.py lookup_candidates()</tt></p></center></html>
<html><center><p>Import as-is</p></center>
<center><p><tt>importer.py import_asis()</tt></p></center></html>
Send 'import_task_start' plugin event
Check if item is album
<html><center><p><tt>ImportTask.lookup_candidates()</tt></p></center>
Item is a singleton
<html><center><p><tt>SingletonImportTask.lookup_candidates()</tt></p></center>
<html><center><p>Find album tags</p></center>
<center><p><tt>autotag.match.py tag_album()</tt></p></center></html>
Folder 3
Get current metadata
Check if IDs exist
<html><center><p>Find albums with ID</p></center>
<center><p><tt>autotag.hooks.album_for_id()</tt></p></center></html>
Folder 4
<html><center><p><tt>autotag.hooks.album_for_mbid()</tt></p></center>
<html><center><p><tt>autotag.hooks.album_for_mbid()</tt></p></center>
<html><center><p><tt>autotag.mb.album_for_id()</tt></p></center>
Success
Send 'albuminfo_received' plugin event
<html><center><p>Check plugin sources for album ID results</p></center>
<center><p><tt>plugins.album_for_id()</tt></p></center></html>
Return matches
Success
<html><center><p>Add candidates to potential matches</p></center>
<center><p><tt>autotag.match._add_candidate()</tt></p></center></html>
Folder 5
Discard empty albums
Filter duplicates
Discard matches without tags
<html><center><p>Find mapping between import items and track info</p></center>
<center><p><tt>assign_items()</tt></p></center></html>
Skip matches with ignored penalties
<html><center><p>Return <tt>AlbumMatch</tt> objects</p></center></html>
<html><center><p>Calculate distance of changes</p></center>
<center><p><tt>distance()</tt></p></center></html>
Use metadata for search
<html><center><p>Search with existing ID</p></center>
<center><p><tt>match_by_id()</tt></p></center></html>
Success
Search with tag terms from metadata
Check if it is a VA release
Collect results from data sources
Sort by distance
<html><center><p>Return <tt>Proposal</tt> with recommendations</p></center></html>
<html><center><p>Get recommendations</p></center>
<center><p><tt>autotag.match.py _recommendation()</tt></p></center></html>
Folder 6
Use configuration threshold
values to classify matches
Downgrade recommendation level if
lower than current recommendation with penalty
<html><center><p>Return <tt>Recommendation</tt> for object</p></center></html>
Get user-input for decision on proposals
Apply as-is choice
autotag.match.distance()
Folder 7
Get current metadata for items
Create autotag.hooks.Distance object
to keep track of penalties
Check if artist is VA
Calculate artist distance
Calculate album difference
Check if album media specified
Check configuration options
Calculate album media distance
Check if medium specified
Check if earliest release preferred
Calculate distance for medium
Assume 1989
Is original year known
Calculate difference between album year
and original year
Calculate maximum difference between
current year and original year
Add distance ratio of year difference and max difference
Check if year specified
Does year match exactly
Add no penalty for year
Prefer match with closest year
Check country distance
Check label distance
Check catalog number distance
Check disambiguation distance
Check album ID difference
Checked all tracks?
Add track distance
Are tracks missing?
Add full penalty
Are there unmatched tracks?
Add full penalty
Apply plugin distance changes
Return autotag.hooks.Distance object
Doesn't Exist
Exists
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No