Skip to content

Commit

Permalink
also test for success in track class
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyJD committed Oct 5, 2013
1 parent 999900e commit 6dd21d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions discid/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@ def __str__(self):
_LIB.discid_get_track_offset.argtypes = (c_void_p, c_int)
_LIB.discid_get_track_offset.restype = c_int
def _get_track_offset(self):
return _LIB.discid_get_track_offset(self._disc._handle, self.number)
if self._disc._success:
return _LIB.discid_get_track_offset(self._disc._handle, self.number)
else:
return None

_LIB.discid_get_track_length.argtypes = (c_void_p, c_int)
_LIB.discid_get_track_length.restype = c_int
def _get_track_length(self):
return _LIB.discid_get_track_length(self._disc._handle, self.number)
if self._disc._success:
return _LIB.discid_get_track_length(self._disc._handle, self.number)
else:
return None

try:
_LIB.discid_get_track_isrc.argtypes = (c_void_p, c_int)
Expand Down

0 comments on commit 6dd21d7

Please sign in to comment.