Skip to content

Conversation

@drhuettl
Copy link

Forces recalculation of the TOC info when using a drive with a
different offset.

Forces recalculation of the TOC info when using a drive with a
different offset.
JoeLametta added a commit to whipper-team/whipper that referenced this pull request Nov 29, 2015
@JoeLametta
Copy link
Contributor

This pull request makes morituri hang on rip cd info with the following traceback:

Traceback (most recent call last):
File "/home/rasty/projects/morituri/bin/rip", line 41, in <module>
sys.exit(main.main(sys.argv[1:]))
File "/home/rasty/projects/morituri/morituri/rip/main.py", line 45, in main
ret = c.parse(argv)
File "/home/rasty/projects/morituri/morituri/rip/main.py", line 123, in parse
logcommand.LogCommand.parse(self, argv)
File "/home/rasty/projects/morituri/morituri/common/logcommand.py", line 62, in parse
command.Command.parse(self, argv)
File "/home/rasty/projects/morituri/morituri/extern/command/command.py", line 401, in parse
return self.subCommands[command].parse(args[1:])
File "/home/rasty/projects/morituri/morituri/common/logcommand.py", line 62, in parse
command.Command.parse(self, argv)
File "/home/rasty/projects/morituri/morituri/extern/command/command.py", line 401, in parse
return self.subCommands[command].parse(args[1:])
File "/home/rasty/projects/morituri/morituri/common/logcommand.py", line 62, in parse
command.Command.parse(self, argv)
File "/home/rasty/projects/morituri/morituri/extern/command/command.py", line 363, in parse
ret = self.do(args)
File "/home/rasty/projects/morituri/morituri/rip/cd.py", line 120, in do
self.ittoc.getMusicBrainzDiscId(), self.device, self.options.offset)
AttributeError: Values instance has no attribute 'offset'

This is a temporary ugly fix which solves this bug:

--- cd.py
+++ cd_fix.py
@@ -113,11 +113,19 @@
                     self.program.ejectDevice(self.device)
                 return -1

-        # now, read the complete index table, which is slower
+        # Ugly fix for broken commit
+        offset = 0
+        info = drive.getDeviceInfo(self.parentCommand.options.device)
+        if info:
+            try:
+                offset = self.getRootCommand().config.getReadOffset(*info)
+            except KeyError:
+                pass

+        # now, read the complete index table, which is slower
         self.itable = self.program.getTable(self.runner,
             self.ittoc.getCDDBDiscId(),
-            self.ittoc.getMusicBrainzDiscId(), self.device, self.options.offset)
+            self.ittoc.getMusicBrainzDiscId(), self.device, offset)

         assert self.itable.getCDDBDiscId() == self.ittoc.getCDDBDiscId(), \
             "full table's id %s differs from toc id %s" % (

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants