Bug#673285: morituri: let user choose the right release

2012-05-17 Thread Marc Dequènes (Duck)

Package: morituri
Version: 0.1.2-2
Tags: patch


Coin,

Using the same rational as #673284, i think morituri arbitrarily  
choosing a release when the medium appears in multiple releases, is a  
bug. It leads to unwanted artist/album/tracks names when ripping, and  
maybe other consequences.


I made a patch asking the user which release is the right one. Someone  
may later add a command line option to avoid interactivity, but at  
least it makes this program useful again.


Regards.

--
Marc Dequènes (Duck)
--- /usr/share/pyshared/morituri/common/program.py.orig2	2012-05-17 15:07:07.204922966 +0200
+++ /usr/share/pyshared/morituri/common/program.py	2012-05-17 15:14:20.638212209 +0200
@@ -374,12 +374,20 @@
 
 if metadatas:
 print 'Matching releases:'
+i = 0
 for metadata in metadatas:
-print 'Artist  : %s' % metadata.artist.encode('utf-8')
-print 'Title   : %s' % metadata.title.encode('utf-8')
+print '%u - %s' % (i, metadata.mbrelease.id)
+print '  Artist  : %s' % metadata.artist.encode('utf-8')
+print '  Title   : %s' % metadata.title.encode('utf-8')
+i += 1
+
+if len(metadatas) == 1:
+  ret = metadatas[0]
+else:
+  print 'Please choose a release'
+  num = raw_input([0-%u]  % i)
+  ret = metadatas[int(num)]
 
-# Select one of the returned releases. We just pick the first one.
-ret = metadatas[0]
 getTracksMetadata(ret, mbdiscid, ittoc)
 else:
 print 'Submit this disc to MusicBrainz at:'


pgp2Qf3APrdy1.pgp
Description: PGP Digital Signature


Bug#673285: morituri: let user choose the right release

2012-05-17 Thread Marc Dequènes (Duck)

Coin,

I forgot to say this patch requires patch in #673284, because the  
logic is intricated, but could be remade if necessary.


--
Marc Dequènes (Duck)


pgpSnDWgApUSN.pgp
Description: PGP Digital Signature