fix: issue with create_hls

This commit is contained in:
Markos Gogoulos 2024-11-20 15:04:27 +02:00
parent 9fc7597e73
commit 5a1e4f25ed
2 changed files with 12 additions and 3 deletions

View File

@ -12,4 +12,8 @@ admin-shell:
build-frontend:
docker-compose -f docker-compose-dev.yaml exec frontend npm run dist
cp -r frontend/dist/static/* static/
docker-compose -f docker-compose-dev.yaml restart web
docker-compose -f docker-compose-dev.yaml restart web
test:
docker compose -f docker-compose-dev.yaml exec --env TESTING=True -T web pytest

View File

@ -439,10 +439,15 @@ def create_hls(friendly_token):
if existing_output_dir:
# override content with -T !
cmd = "cp -rT {0} {1}".format(output_dir, existing_output_dir)
cmd = ["cp", "-rT", output_dir, existing_output_dir]
run_command(cmd)
shutil.rmtree(output_dir)
try:
shutil.rmtree(output_dir)
except: # noqa
# this was breaking in some cases where it was already deleted
# because create_hls was running multiple times
pass
output_dir = existing_output_dir
pp = os.path.join(output_dir, "master.m3u8")
if os.path.exists(pp):