wilsonyu2006 / mutagen

Automatically exported from code.google.com/p/mutagen
GNU General Public License v2.0
0 stars 0 forks source link

values loaded as NumericTextFrame even when not numeric #126

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
  File "media/metadata.py", line 2, in u
    return + tagvalue
  File "lib/mutagen/id3.py", line 11, in __pos__
    return int(self.text[0])
ValueError: 'invalid literal for int() with base 10: 'www.example.com''

class NumericTextFrame(TextFrame):
    """Numerical text strings.

    The numeric value of these frames can be gotten with unary plus, e.g.
        frame = TLEN('12345')
        length = +frame
    """

Perhaps my thinking is backwards, but I think the value of the data should 
inform the type.  There is no end of junk in MP3 files.  Mutagen should make 
fewer assumptions that a type that is what the spec says it should be.

Original issue reported on code.google.com by chadmill on 10 Oct 2012 at 7:11

GoogleCodeExporter commented 8 years ago
Use NumericTextFrame.text

Original comment by reiter.christoph@gmail.com on 10 Oct 2012 at 8:03