Handle off-by-1 errors in cdparanoia progress parsing

Fixes the exception I got on ripping The Strokes - Someday
This commit is contained in:
Thomas Vander Stichele
2013-02-24 11:37:13 +01:00
parent f890ba7f57
commit 3f4291bb18
8 changed files with 181 additions and 13 deletions

View File

@@ -318,3 +318,21 @@ class TOTBLTestCase(common.TestCase):
def testCDDBId(self):
self.toc.table.absolutize()
self.assertEquals(self.toc.table.getCDDBDiscId(), '810b7b0b')
# The Strokes - Someday has a 1 frame SILENCE marked as such in toc
class StrokesTestCase(common.TestCase):
def setUp(self):
self.path = os.path.join(os.path.dirname(__file__),
u'strokes-someday.toc')
self.toc = toc.TocFile(self.path)
self.toc.parse()
self.assertEquals(len(self.toc.table.tracks), 1)
def testIndexes(self):
t = self.toc.table.tracks[0]
self.assertEquals(t.getIndex(0).relative, 0)
self.assertEquals(t.getIndex(1).relative, 1)