Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to rip if MB Release doesn't have a release date/year #133

Closed
Freso opened this issue Feb 13, 2017 · 4 comments · Fixed by #139
Closed

Fails to rip if MB Release doesn't have a release date/year #133

Freso opened this issue Feb 13, 2017 · 4 comments · Fixed by #139
Labels
Bug Generic bug: can be used together with more specific labels

Comments

@Freso
Copy link
Member

Freso commented Feb 13, 2017

Running from git/master (at commit 2367286) trying to rip a release without a release date in MusicBrainz, whipper fails to rip because "None is not a valid value".

Output:

Using configured read offset 6
Checking device /dev/sr0
eject: Cd-rom-kommandoen luk skuffen mislykkedes: Inddata/uddata-fejl
CDDB disc id: e70c9a10
MusicBrainz disc id q.7rqJOjiR6XvdpLG5dtFJBU2vE-
MusicBrainz lookup URL https://musicbrainz.org/cdtoc/attach?toc=1+16+242152+150+16934+32882+47589+65818+81773+99449+113865+133080+149133+154862+169271+178281+189639+207273+225411&tracks=16&id=q.7rqJOjiR6XvdpLG5dtFJBU2vE-
Disc duration: 00:53:46.693, 16 audio tracks
WARNING:morituri.common.mbngs:Release with ID '2fd724e6-5152-4f53-9c7e-e76e6f88e850' (Maytzo - Nature) does not have a date
WARNING:morituri.common.mbngs:Release with ID '2fd724e6-5152-4f53-9c7e-e76e6f88e850' (Maytzo - Nature) does not have a date
WARNING:morituri.common.mbngs:Release with ID '2fd724e6-5152-4f53-9c7e-e76e6f88e850' (Maytzo - Nature) does not have a date
WARNING:morituri.common.mbngs:Release with ID '2fd724e6-5152-4f53-9c7e-e76e6f88e850' (Maytzo - Nature) does not have a date

Matching releases:

Artist  : Maytzo
Title   : Nature
Duration: 00:53:18.677
URL     : https://musicbrainz.org/release/2fd724e6-5152-4f53-9c7e-e76e6f88e850
Release : 2fd724e6-5152-4f53-9c7e-e76e6f88e850
Type    : Album
Cat no  : [none]

** Message: pygobject_register_sinkfunc is deprecated (GstObject)
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
Creating output directory Maytzo - Nature (0000) [FLAC]
Ripping track 1 of 16: 01. Maytzo - Fantasy.flac
Traceback (most recent call last):        
  File "/usr/lib/python2.7/site-packages/morituri/extern/task/task.py", line 511, in c
    callable(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/morituri/common/encode.py", line 226, in _tag
    w.save()
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 158, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 129, in wrapper
    return func(self, h, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 860, in save
    self.metadata_blocks, available, content_size, padding)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 154, in _writeblocks
    data += cls._writeblock(block)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 126, in _writeblock
    datum = block.write()
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 354, in write
    return super(VCFLACDict, self).write(framing=framing)
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 191, in write
    self.validate()
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 171, in validate
    raise ValueError("%r is not a valid value" % value)
ValueError: None is not a valid value
Ripping track 1 of 16 (try 2): 01. Maytzo - Fantasy.flac
Traceback (most recent call last):                
  File "/usr/lib/python2.7/site-packages/morituri/extern/task/task.py", line 511, in c
    callable(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/morituri/common/encode.py", line 226, in _tag
    w.save()
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 158, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 129, in wrapper
    return func(self, h, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 860, in save
    self.metadata_blocks, available, content_size, padding)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 154, in _writeblocks
    data += cls._writeblock(block)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 126, in _writeblock
    datum = block.write()
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 354, in write
    return super(VCFLACDict, self).write(framing=framing)
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 191, in write
    self.validate()
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 171, in validate
    raise ValueError("%r is not a valid value" % value)
ValueError: None is not a valid value
Ripping track 1 of 16 (try 3): 01. Maytzo - Fantasy.flac
Traceback (most recent call last):                
  File "/usr/lib/python2.7/site-packages/morituri/extern/task/task.py", line 511, in c
    callable(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/morituri/common/encode.py", line 226, in _tag
    w.save()
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 158, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 129, in wrapper
    return func(self, h, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 860, in save
    self.metadata_blocks, available, content_size, padding)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 154, in _writeblocks
    data += cls._writeblock(block)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 126, in _writeblock
    datum = block.write()
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 354, in write
    return super(VCFLACDict, self).write(framing=framing)
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 191, in write
    self.validate()
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 171, in validate
    raise ValueError("%r is not a valid value" % value)
ValueError: None is not a valid value
Ripping track 1 of 16 (try 4): 01. Maytzo - Fantasy.flac
Traceback (most recent call last):                
  File "/usr/lib/python2.7/site-packages/morituri/extern/task/task.py", line 511, in c
    callable(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/morituri/common/encode.py", line 226, in _tag
    w.save()
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 158, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 129, in wrapper
    return func(self, h, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 860, in save
    self.metadata_blocks, available, content_size, padding)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 154, in _writeblocks
    data += cls._writeblock(block)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 126, in _writeblock
    datum = block.write()
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 354, in write
    return super(VCFLACDict, self).write(framing=framing)
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 191, in write
    self.validate()
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 171, in validate
    raise ValueError("%r is not a valid value" % value)
ValueError: None is not a valid value
Ripping track 1 of 16 (try 5): 01. Maytzo - Fantasy.flac
Traceback (most recent call last):                
  File "/usr/lib/python2.7/site-packages/morituri/extern/task/task.py", line 511, in c
    callable(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/morituri/common/encode.py", line 226, in _tag
    w.save()
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 158, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/_util.py", line 129, in wrapper
    return func(self, h, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 860, in save
    self.metadata_blocks, available, content_size, padding)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 154, in _writeblocks
    data += cls._writeblock(block)
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 126, in _writeblock
    datum = block.write()
  File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 354, in write
    return super(VCFLACDict, self).write(framing=framing)
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 191, in write
    self.validate()
  File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line 171, in validate
    raise ValueError("%r is not a valid value" % value)
ValueError: None is not a valid value
CRITICAL:morituri.command.cd:Giving up on track 1 after 5 times
Traceback (most recent call last):
  File "/usr/bin/whipper", line 11, in <module>
    load_entry_point('whipper==0.4.2', 'console_scripts', 'whipper')()
  File "/usr/lib/python2.7/site-packages/morituri/command/main.py", line 31, in main
    ret = cmd.do()
  File "/usr/lib/python2.7/site-packages/morituri/command/basecommand.py", line 123, in do
    return self.cmd.do()
  File "/usr/lib/python2.7/site-packages/morituri/command/basecommand.py", line 123, in do
    return self.cmd.do()
  File "/usr/lib/python2.7/site-packages/morituri/command/cd.py", line 206, in do
    self.doCommand()
  File "/usr/lib/python2.7/site-packages/morituri/command/cd.py", line 507, in doCommand
    ripIfNotRipped(i + 1)
  File "/usr/lib/python2.7/site-packages/morituri/command/cd.py", line 447, in ripIfNotRipped
    "track can't be ripped. "
RuntimeError: track can't be ripped. Rip attempts number is equal to 'MAX_TRIES'
@JoeLametta
Copy link
Collaborator

JoeLametta commented Feb 13, 2017

Does it still fail if testing whipper at 0e395e5? (I suspect this is a regression which has been introduced with #121)

@JoeLametta JoeLametta added the Bug Generic bug: can be used together with more specific labels label Feb 13, 2017
@JoeLametta
Copy link
Collaborator

JoeLametta commented Feb 20, 2017

Sorry (accidental button press).

As the release date metadata used by the tagging task can be NoneType, we need to add a check for this here. Something like this should be enough:

--- whipper-master/morituri/common/program.py
+++ whipper-edited/morituri/common/program.py
@@ -462,7 +462,8 @@
         tags['TRACKNUMBER'] = u'%s' % number
 
         if self.metadata:
-            tags['DATE'] = self.metadata.release
+            if self.metadata.release:
+                tags['DATE'] = self.metadata.release
 
             if number > 0:
                 tags['MUSICBRAINZ_TRACKID'] = mbidTrack

I haven't verified if there are other similar cases (regarding the tagging task) which may produce an erroneous condition like the one reported here...

@ArchangeGabriel
Copy link

@JoeLametta Even if this search could be done locally on a computer, you’ve made me found one reason to stop being a fork of morituri: https://github.com/JoeLametta/whipper/search?q=self.metadata&type=Code&utf8=%E2%9C%93

@Freso
Copy link
Member Author

Freso commented Feb 21, 2017

I did a git bisect which indeed revealed that 6ddb5d0 is the first bad commit—ie., 6ddb5d0 is the commit that introduced this regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Generic bug: can be used together with more specific labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants