more cut_races features

condor-scripts
Mike Lang 3 years ago
parent c37d44f7c5
commit e9e89fd05f

@ -32,7 +32,7 @@ def main(
output_dir,
host='condor.live', user='necrobot-read', password='necrobot-read', database='condor_xii',
base_dir='/srv/wubloader', start_range='0,10', non_interactive=False, restrict_league=None,
only_match_id=0,
only_match_id=0, best_effort_no_segments=False,
):
logging.basicConfig(level=logging.INFO)
start_range = map(int, start_range.split(","))
@ -77,6 +77,7 @@ def main(
"output_range": (-5, 30),
"time_offset": 0,
} if name.startswith("caw-") or league == "gru" else {}
try:
try:
cut_sync_race.cut_race(
base_dir, output_temp, temp_dir, stream, start, duration,
@ -84,7 +85,15 @@ def main(
**no_sync_kwargs
)
except cut_sync_race.NoSegments as e:
logging.warning(e)
if not best_effort_no_segments:
raise
logging.warning("{}\nTrying to cut as much of the race as we have, from -5 to +30".format(e))
cut_sync_race.cut_race(
base_dir, output_temp, temp_dir, stream, start, duration,
non_interactive=True, output_range=(-5, 30), time_offset=0,
)
except cut_sync_race.NoSegments as e:
logging.error(e)
except Exception as e:
logging.exception("Failed to cut {}".format(output_path), exc_info=True)
if not non_interactive:

Loading…
Cancel
Save