Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't go berserk on media without a duration
  • Loading branch information
Sebastian Sareyko committed Jan 15, 2009
1 parent 7404c16 commit 4a7b9db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion AlbumThing/album.py
Expand Up @@ -50,7 +50,8 @@ def increase_size(self, size=1):


def add_duration(self, duration):
self.duration = self.duration + duration
if duration:
self.duration = self.duration + duration


def get_cover_image(self):
Expand Down
6 changes: 5 additions & 1 deletion AlbumThing/controls.py
Expand Up @@ -40,7 +40,11 @@ def __init__(self):
def __xmms_cb_id_info(self, result):
if not result.value():
return
self.__duration = result.value()['duration']
try:
self.__duration = result.value()['duration']
except KeyError:
# FIXME: Non-seekable stream?
pass


def __xmms_cb_current_id(self, result):
Expand Down

0 comments on commit 4a7b9db

Please sign in to comment.