Skip to content

Commit

Permalink
archive.py: also merge the metadata
Browse files Browse the repository at this point in the history
Perform the metadata merge step at the end of archive.py, to reduce the
number of separate scripts users must run.
  • Loading branch information
simpkins committed Apr 10, 2011
1 parent 46aa8ad commit c6bd7e9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/archive.py
Expand Up @@ -7,7 +7,9 @@

from amass import archive
from amass import cddb
from amass import file_util
from amass import mb
from amass import metadata


def main(argv):
Expand All @@ -27,16 +29,25 @@ def main(argv):
print >> sys.stderr, 'trailing arguments: %s' % (args,)
return 1

# Save the data off the physical CD
archiver = archive.Archiver(options.device)
dir = archiver.archive()

if options.archive_only:
return os.EX_OK

# Fetch metadata information from CDDB and MusicBrainz
toc = dir.album.toc
cddb.fetch_cddb(toc, dir)
mb.fetch_mb(toc, dir)

# Merge the metadata information
metadata.merge.automerge(dir)
chooser = metadata.merge.CliChooser(dir, 100)
chooser.choose()
with file_util.open_new(dir.layout.getMetadataInfoPath()) as f:
dir.album.writeTracks(f)


if __name__ == '__main__':
rc = main(sys.argv)

0 comments on commit c6bd7e9

Please sign in to comment.