Your message dated Wed, 26 Jun 2013 23:37:53 +0200
with message-id <[email protected]>
and subject line Re: Bug#673284: this was fixed in 0.1.3
has caused the Debian Bug report #673284,
regarding morituri: support releases with multiple mediums
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
673284: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673284
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: morituri
Version: 0.1.2-2


Coin,

Ripping releases with multiple medium is broken, see:
  http://thomas.apestaart.org/morituri/trac/ticket/67

As this is not a rare situation and the main goal of this program, i do not consider this a wish but a bug (thus the severity).

Unfortunately, the next version is probably not coming soon. This bug was closed 4 months ago, not so much activity recently, and there is still much to do:
  http://thomas.apestaart.org/morituri/trac/query?group=status&milestone=0.1.3

Moreover, there is no way to properly solve the situation using python-musicbrainz2 because the new MusicBrainZ's API is necessary to compute which tracks are in the selected medium.

I made a patch to work around this problem. For the first and last medium the track offset can be guessed, and in all other cases the user is asked to manually enter the track offset. I'm not a Python developper, so my patch is probably not the most beautiful ever, but it seems to work nicely.

I think applying this patch would be nice for Wheezy, because the next version will clearly not be ready for it. When the next version is released, this patch would be obsolete and you'd just have to remove it, so there should be no maintenance work.

Regards.

--
Marc Dequènes (Duck)
--- /usr/share/pyshared/morituri/common/program.py.orig	2012-05-15 00:54:00.193503421 +0200
+++ /usr/share/pyshared/morituri/common/program.py	2012-05-17 15:01:24.072825041 +0200
@@ -56,12 +56,25 @@
     mbid = None
     mbidArtist = None
 
+    mbrelease = None
+
     def __init__(self):
         self.tracks = []
 
 def filterForPath(text):
     return "-".join(text.split("/"))
 
+# borrowed from http://kraehen.org/isrcsubmit.py
+# Copyright (C) 2010-2012 Johannes Dewender
+# GPL-3+
+def askForOffset(release, discTrackCount, releaseTrackCount):
+    print
+    print "Could not determine starting track."
+    print "Please look at the following URL: %s" % release.id
+    print "How many tracks are on the previous (actual) discs altogether?"
+    num = raw_input("[0-%d] " % (releaseTrackCount - discTrackCount))
+    return int(num)
+
 def getMetadata(release):
     """
     @rtype: L{DiscMetadata}
@@ -78,10 +91,40 @@
     metadata.mbid = urlparse.urlparse(release.id)[2].split("/")[-1]
     metadata.mbidArtist = urlparse.urlparse(release.artist.id)[2].split("/")[-1]
 
+    metadata.mbrelease = release
+
+    return metadata
+
+def getTracksMetadata(metadata, discid, ittoc):
+    release = metadata.mbrelease
 
-    for t in release.tracks:
+    disc = None
+    discId = 1
+    for d in release.discs:
+        if d.id == discid:
+            disc = d
+            break
+        discId += 1
+    # should never happen
+    if disc is None:
+        raise MusicBrainzException("wanted disc cannot be found in release")
+    print 'Disc ID: %u' % discId
+
+    discTrackCount = ittoc.getAudioTracks()
+    releaseTrackCount = len(release.tracks)
+
+    if discId == 1:
+        trackOffset = 0
+    elif discId == len(release.discs):
+        trackOffset = releaseTrackCount - discTrackCount
+    else:
+        trackOffset = askForOffset(release, discTrackCount, releaseTrackCount)
+    print 'Track Offset: %u' % trackOffset
+
+    for i in range(trackOffset, trackOffset + discTrackCount):
+        t = release.tracks[i]
         track = TrackMetadata()
-        if isSingleArtist or t.artist == None:
+        if not metadata.various or t.artist == None:
             track.artist = metadata.artist
             track.sortName = metadata.sortName
             track.mbidArtist = metadata.mbidArtist
@@ -95,9 +138,6 @@
         track.mbid = urlparse.urlparse(t.id)[2].split("/")[-1]
         metadata.tracks.append(track)
 
-    return metadata
-
-
 def musicbrainz(discid):
     """
     @rtype: list of L{DiscMetadata}
@@ -134,7 +174,7 @@
         # The returned release object only contains title and artist, but no
         # tracks.  Query the web service once again to get all data we need.
         try:
-            inc = mbws.ReleaseIncludes(artist=True, tracks=True,
+            inc = mbws.ReleaseIncludes(artist=True, tracks=True, discs=True,
                 releaseEvents=True)
             # Arid - Under the Cold Street Lights has getId() None
             if release.getId():
@@ -340,6 +380,7 @@
 
             # 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:'
             print ittoc.getMusicBrainzSubmitURL()

Attachment: pgpSZiMmgxeNr.pgp
Description: PGP Digital Signature


--- End Message ---
--- Begin Message ---
Version: 0.1.3-1

Fixed in version 0.1.3, according to upstream author.

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

Attachment: signature.asc
Description: signature


--- End Message ---

Reply via email to