diff --git a/ChangeLog b/ChangeLog index d1302ff..848bf76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-04-13 Thomas Vander Stichele + + * morituri/image/image.py: + Add an object to parse the response of AccurateRip. + * morituri/test/test_image_image.py: + * morituri/test/dBAR-011-0010e284-009228a3-9809ff0b.bin (added): + Add a test for it, based on my Kings Of Leon CD. + 2009-04-13 Thomas Vander Stichele * morituri/image/image.py: diff --git a/morituri/image/image.py b/morituri/image/image.py index 45f5193..bdd36e8 100644 --- a/morituri/image/image.py +++ b/morituri/image/image.py @@ -25,6 +25,7 @@ Wrap on-disk CD images based on the .cue file. """ import os +import struct import gst @@ -307,3 +308,32 @@ class ImageVerifyTask(MultiTask): self.lengths[trackIndex] = end - offset MultiTask.stop(self) + +class AccurateRipResponse(object): + """ + I represent the response of the AccurateRip online database. + """ + + trackCount = None + discId1 = "" + discId2 = "" + cddbDiscId = "" + confidences = None + crcs = None + + def __init__(self, data): + self.trackCount = struct.unpack("B", data[0])[0] + self.discId1 = "%08x" % struct.unpack("