[SCM] morituri/master: * morituri/common/program.py: AccurateRip responses should be treated per track; one response set isn't necessarily from the same pressing. The first response set contains all the highest confidence checksums, and so on in decreasing order. So don't assert about one track having a checksum matching from a different response set. Fixes #5.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:09:26 UTC 2014


The following commit has been merged in the master branch:
commit e47b30610d6285f0534c945c4009b8b2181933fc
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sun May 22 23:26:32 2011 +0000

    	* morituri/common/program.py:
    	  AccurateRip responses should be treated per track; one response set
    	  isn't necessarily from the same pressing.
    	  The first response set contains all the highest confidence
    	  checksums, and so on in decreasing order.
    	  So don't assert about one track having a checksum matching from
    	  a different response set.
    	  Fixes #5.

diff --git a/ChangeLog b/ChangeLog
index a7f41a5..592864f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-05-23  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* morituri/common/program.py:
+	  AccurateRip responses should be treated per track; one response set
+	  isn't necessarily from the same pressing.
+	  The first response set contains all the highest confidence
+	  checksums, and so on in decreasing order.
+	  So don't assert about one track having a checksum matching from
+	  a different response set.
+	  Fixes #5.
+
 2011-05-22  Thomas Vander Stichele  <thomas at apestaart dot org>
 
 	based on code by: Loïc Minier <lool at dooz.org>
diff --git a/morituri/common/program.py b/morituri/common/program.py
index 90a29f2..9d6fe83 100644
--- a/morituri/common/program.py
+++ b/morituri/common/program.py
@@ -532,31 +532,26 @@ class Program(log.Loggable):
             self.warning('No AccurateRip responses, cannot verify.')
             return
 
-        response = None # track which response matches, for all tracks
-
         # now loop to match responses
         for i, csum in enumerate(checksums):
             trackResult = self.result.getTrackResult(i + 1)
 
             confidence = None
+            response = None
 
             # match against each response's checksum for this track
             for j, r in enumerate(responses):
                 if "%08x" % csum == r.checksums[i]:
-                    if not response:
-                        response = r
-                    else:
-                        assert r == response, \
-                            "checksum %08x for track %d matches wrong response %d, "\
-                            "checksum %s" % (
-                                csum, i + 1, j + 1, response.checksums[i])
-                    self.debug("Track: %02d matched in AccurateRip database",
-                        i + 1)
+                    response = r
+                    self.debug(
+                        "Track %02d matched response %d of %d in "
+                        "AccurateRip database",
+                        i + 1, j + 1, len(responses))
                     trackResult.accurip = True
                     # FIXME: maybe checksums should be ints
-                    trackResult.ARDBCRC = int(response.checksums[i], 16)
+                    trackResult.ARDBCRC = int(r.checksums[i], 16)
                     # arsum = csum
-                    confidence = response.confidences[i]
+                    confidence = r.confidences[i]
                     trackResult.ARDBConfidence = confidence
 
             if not trackResult.accurip:

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list