diff --git a/.gitignore b/.gitignore index c6c566f6..c4b0546e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ .ropeproject -server.py -**wip **temp **playlists *.log* diff --git a/wip/2019-03-05.json b/wip/2019-03-05.json new file mode 100644 index 00000000..901ab4a9 --- /dev/null +++ b/wip/2019-03-05.json @@ -0,0 +1,34 @@ +{ + "channel": "Test 1", + "date": "2019-03-05", + "begin": "06:00:00.000", + "length": "24:00:00.000", + "program": [{ + "in": 0, + "out": 647.68, + "duration": 647.68, + "source": "/Media/clip1.mp4" + }, + + { + "in": 0, + "out": 149, + "duration": 149, + "source": "/Media/clip2.mp4" + }, + + { + "in": 0, + "out": 114.72, + "duration": 114.72, + "source": "/Media/clip3.mp4" + }, + + { + "in": 0, + "out": 2531.36, + "duration": 2531.36, + "source": "/Media/clip4.mp4" + } + ] +} diff --git a/wip/json-reader.py b/wip/json-reader.py new file mode 100644 index 00000000..0de8b7be --- /dev/null +++ b/wip/json-reader.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import json + +with open('2019-03-05.json') as f: + data = json.load(f) + +h, m, s = data["begin"].split(':') +begin = float(h) * 3600 + float(m) * 60 + float(s) + +for item in data["program"]: + inp = item["in"] + out = item["out"] + duration = item["duration"] + + print(begin) + begin += out - inp