* examples/readdisc.py:

Get our metadata only from the toc.
This commit is contained in:
Thomas Vander Stichele
2009-05-16 09:01:37 +00:00
parent cc61a1d2dd
commit 1a55ff8eaa
2 changed files with 11 additions and 3 deletions

View File

@@ -219,14 +219,19 @@ def main(argv):
runner = taskgtk.GtkProgressRunner()
function = gtkmain
# first, read the normal TOC and full index table
# first, read the normal TOC, which is fast
ptoc = common.Persister(options.toc_pickle or None)
if not ptoc.object:
t = cdrdao.ReadTOCTask()
function(runner, t)
ptoc.persist(t.table)
ittoc = ptoc.object
assert ittoc.hasTOC()
# already show us some info based on this
metadata = musicbrainz(ittoc.getMusicBrainzDiscId())
# now, read the complete index table, which is slower
ptable = common.Persister(options.table_pickle or None)
if not ptable.object:
t = cdrdao.ReadIndexTableTask()
@@ -238,8 +243,6 @@ def main(argv):
lastTrackStart = 0
metadata = musicbrainz(itable.getMusicBrainzDiscId())
# check for hidden track one audio
htoapath = None
index = None