Changeset 553


Ignore:
Timestamp:
19-10-11 20:15:42 (20 months ago)
Author:
thomas
Message:
  • morituri/rip/debug.py: Add rip debug musicbrainz command to look up information on disc id's.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r552 r553  
     12011-10-19  Thomas Vander Stichele  <thomas at apestaart dot org> 
     2 
     3        * morituri/rip/debug.py: 
     4          Add rip debug musicbrainz command to look up information on 
     5          disc id's. 
     6 
    172011-10-19  Thomas Vander Stichele  <thomas at apestaart dot org> 
    28 
  • trunk/morituri/rip/debug.py

    r529 r553  
    8383        runner.run(encodetask) 
    8484 
     85class MusicBrainz(logcommand.LogCommand): 
     86 
     87    summary = "examine MusicBrainz info" 
     88 
     89 
     90    def do(self, args): 
     91        try: 
     92            discId = unicode(args[0]) 
     93        except IndexError: 
     94            self.stdout.write('Please specify a MusicBrainz disc id.\n') 
     95            return 3 
     96 
     97        from morituri.common import program 
     98        metadatas = program.musicbrainz(discId) 
     99 
     100        self.stdout.write('%d releases\n' % len(metadatas)) 
     101        for i, md in enumerate(metadatas): 
     102            self.stdout.write('- Release %d:\n' % (i + 1, )) 
     103            self.stdout.write('    Artist: %r\n' % md.artist) 
     104            self.stdout.write('    Title:  %r\n' % md.title) 
     105            self.stdout.write('    URL: %r\n' % md.url) 
     106            self.stdout.write('    Tracks: %r\n' % len(md.tracks)) 
     107            for j, track in enumerate(md.tracks): 
     108                self.stdout.write('      Track %2d: %r - %r\n' % ( 
     109                    j, track.artist, track.title)) 
     110 
    85111class Debug(logcommand.LogCommand): 
    86112    summary = "debug internals" 
    87113 
    88     subCommandClasses = [Checksum, Encode, ] 
    89  
    90  
     114    subCommandClasses = [Checksum, Encode, MusicBrainz, ] 
Note: See TracChangeset for help on using the changeset viewer.