Video Duration: The duration of a video is now shown on thumbnails and bellow the video player
Asset nodes now have a new field called "properties.duration_seconds". This holds a copy of the duration stored on the referenced video file and stays in sync using eve hooks. To migrate existing duration times from files to nodes you need to run the following: ./manage.py maintenance reconcile_node_video_duration -ag There are 2 more maintenance commands to be used to determine if there are any missing durations in either files or nodes: find_video_files_without_duration find_video_nodes_without_duration FFProbe is now used to detect what duration a video file has. Reviewed by Sybren.
This commit is contained in:
@@ -212,3 +212,17 @@ class TestRating(unittest.TestCase):
|
||||
sorted_by_hot = sorted(cases, key=lambda tup: tup[0])
|
||||
for idx, t in enumerate(sorted_by_hot):
|
||||
self.assertEqual(cases[idx][0], t[0])
|
||||
|
||||
|
||||
class TestPrettyDuration(unittest.TestCase):
|
||||
def test_formatting(self):
|
||||
from pillar.api.utils import pretty_duration
|
||||
pretty_duration(500)
|
||||
self.assertEquals('00:00', pretty_duration(0))
|
||||
self.assertEquals('00:15', pretty_duration(15))
|
||||
self.assertEquals('01:05', pretty_duration(65))
|
||||
self.assertEquals('42:53', pretty_duration(2573))
|
||||
self.assertEquals('01:11:22', pretty_duration(4282))
|
||||
self.assertEquals('01:41', pretty_duration(100.85))
|
||||
self.assertEquals('25:00:00', pretty_duration(90000)) # More than a day
|
||||
self.assertEquals('', pretty_duration(None))
|
||||
|
Reference in New Issue
Block a user