check only length

This commit is contained in:
jb-alvarado 2019-07-21 00:54:06 +02:00
parent 2468fbcbaf
commit c6f448f2ce
2 changed files with 23 additions and 26 deletions

View File

@ -67,7 +67,7 @@ JSON Playlist Example
} }
``` ```
`"length"` are optional, when you leave **day_start** in config blank, length check will be ignored and the playlist starts from the begin, without time awareness. If you leave **length** blank, the validation will not check if the real length of the playlist will match the length value. `"length"` are optional, when you leave it blank, there will be no check if real playlist length is correct.
#### Warning: #### Warning:
(Endless) streaming over multiple days will only work when config have **day_start** value and the **length** value of the playlist is **24 hours**. If you need only some hours for every day, use a *cron* job, or something similar. (Endless) streaming over multiple days will only work when config have **day_start** value and the **length** value of the playlist is **24 hours**. If you need only some hours for every day, use a *cron* job, or something similar.

View File

@ -26,12 +26,11 @@ import logging
import math import math
import os import os
import random import random
import smtplib
import signal import signal
import smtplib
import socket import socket
import sys import sys
import time import time
from argparse import ArgumentParser from argparse import ArgumentParser
from datetime import date, datetime, timedelta from datetime import date, datetime, timedelta
from email.mime.multipart import MIMEMultipart from email.mime.multipart import MIMEMultipart
@ -324,10 +323,8 @@ def check_sync(begin, encoder):
sys.exit(1) sys.exit(1)
# check begin and length
def check_start_and_length(json_nodes, total_play_time):
if _playlist.start:
# check if playlist is long enough # check if playlist is long enough
def check_length(json_nodes, total_play_time):
if 'length' in json_nodes: if 'length' in json_nodes:
l_h, l_m, l_s = json_nodes["length"].split(':') l_h, l_m, l_s = json_nodes["length"].split(':')
if is_float(l_h) and is_float(l_m) and is_float(l_s): if is_float(l_h) and is_float(l_m) and is_float(l_s):
@ -402,7 +399,7 @@ def validate_thread(clip_nodes):
'values are missing:\n{}'.format(error) 'values are missing:\n{}'.format(error)
) )
check_start_and_length(json_nodes, counter) check_length(json_nodes, counter)
validate = Thread(name='check_json', target=check_json, args=(clip_nodes,)) validate = Thread(name='check_json', target=check_json, args=(clip_nodes,))
validate.daemon = True validate.daemon = True