This lets us do a lot of the basic Thread operations through common
code, allowing us to focus on tagging in this file instead of basic
Thread controls.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This includes both creating new Tracks and updating existing Tracks when
their tags have changed. New tracks are added to playlists using
idle=True so Gtk can spread out UI updates for each playlist so we don't
slow things down too much for the user.
This patch also adds a library argument to the Tagger thread
get_result() function which we pass to the Tagger class to be used by
Tracks.creat(). I also add an mtime argument to the Tagger thread
tag_file() function to pass down to the audio.tagger layer so we can
skip updating tracks that have not changed since the last scan.
Implements: #41 (Check for new or modified tags during startup)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I extract the artist, length, mbid, mtime, tracknumber, and title from
the tags to use when constructing Tracks.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This Thread uses the audio.tagger.tag_file() function to find the tags
for a specific file without hanging the UI. There may be cases where we
have an Artist MBID but not the matching Artist name. When this happens,
I do my best to first check the database and then query the musicbrainz
server.
I take some care to only connect to the database once, and to close the
connection when the thread exits.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This tool wraps around a mutagen.File to read tags and translate them
into our database playlists.
Implements: #41 ("Check for new or modified tags during startup")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>