duration is a time delta
This commit is contained in:
parent
118c26fe31
commit
b86e9d8a00
7 changed files with 16 additions and 18 deletions
|
|
@ -23,13 +23,13 @@ __all__ = ['BaseVideo', 'ICapVideo']
|
|||
|
||||
|
||||
class BaseVideo(object):
|
||||
def __init__(self, _id, title=None, url=None, author=None, duration=0, date=None,
|
||||
def __init__(self, _id, title=None, url=None, author=None, duration=None, date=None,
|
||||
rating=0.0, rating_max=0.0, thumbnail_url=None, nsfw=False):
|
||||
self.id = unicode(_id)
|
||||
self.title = title
|
||||
self.url = url
|
||||
self.author = author
|
||||
self.duration = int(duration)
|
||||
self.duration = duration
|
||||
self.date = date
|
||||
self.rating = float(rating)
|
||||
self.rating_max = float(rating_max)
|
||||
|
|
@ -41,10 +41,6 @@ class BaseVideo(object):
|
|||
"""Overloaded in child classes provided by backends."""
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def formatted_duration(self):
|
||||
return '%d:%02d:%02d' % (self.duration / 3600, (self.duration % 3600 / 60), self.duration % 60)
|
||||
|
||||
@property
|
||||
def page_url(self):
|
||||
return self.id2url(self.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue