Closed GoogleCodeExporter closed 9 years ago
Some more info: the album I looked up in the above case was not in the Last.fm
database. However, my code
checks to see if the Album constructor returns None and doesn't try to get the
image if that is the case. So I
think the problem is just that pylast isn't returning None when an album isn't
found. (Also the documentation
doesn't mention what should be returned in that case either, so maybe that
could be improved too.)
Original comment by codemo...@gmail.com
on 21 Aug 2008 at 12:33
yeah, actually pylast object don't check if the metdata exists on the last.fm
servers
on construction. but an ServiceException is raised if an operation was
attempted on a
non-existent object. of course, with the silent exception handling, you don't
get to
see the exception, but you can check for it by calling object.last_error().
operations that fail always return None and raises an exception (silent or
not), so
getImage() should return None if a ServiceException is raised because the album
is
not on the server's database. i'll get on fixing that right away. i'll try to
write
more on the silent exception handling in the wiki, it's just that documenting
code is
pretty damn boring, i look for any excuse to get away from it. check the svn in
the
next few minutes for an update. thanks for taking the time to report that..
Original comment by amr.hassan
on 21 Aug 2008 at 8:34
Original issue reported on code.google.com by
codemo...@gmail.com
on 21 Aug 2008 at 12:27