in03 / proxima

Transcode source media directly from DaVinci Resolve using multiple machines for encoding. Great for creating proxies quickly.
MIT License
50 stars 3 forks source link

Fix bar column not lining up with task_progress bars #192

Closed github-actions[bot] closed 2 years ago

github-actions[bot] commented 2 years ago

Fix bar column not lining up with task_progress bars

Maybe we can make a spacer text column for all the bars and truncate long filenames with [...]?

print(f"Matched tasks: {tt.matched_task_ids}")

If we've got task progress update

https://github.com/in03/Resolve-Proxy-Encoder/blob/553db65c74cd3e89e89d9757d48aef93d6de2167/resolve_proxy_encoder/queuer/queue.py#L98


    )

    overall_progress = Progress(
        TextColumn("[cyan]{task.description}"),
        # TODO: Fix bar column not lining up with task_progress bars
        # Maybe we can make a spacer text column for all the bars and truncate long filenames with [...]?
        # labels: bug
        BarColumn(),
        TextColumn("[cyan]({task.completed} of {task.total})"),
    )

    # Create group of renderables
    progress_group = Group(
        worker_spinner,
        task_progress,
        overall_progress,
    )

    overall_id = overall_progress.add_task(
        description="Total task progress",
        total=len(callable_tasks),
    )

    worker_id = worker_spinner.add_task(
        description="Active worker count", worker_count=0
    )

    # If not finished, report progress
    mini_bars = {}
    active_workers = []
    completed_tasks = 0

    with Live(progress_group):

        while not results.ready():

            # Update overall progress
            tt_data = tt.get_data(group_id=results.id)
            if tt_data:

                # Update overall task progress
                task_event = tt_data.get("task-event")
                if task_event:

                    # Finished a task, update completed
                    if task_event["status"] in ["SUCCESS", "FAILURE"]:

                        completed_tasks = completed_tasks + 1
                        overall_progress.update(
                            task_id=overall_id,
                            completed=completed_tasks,
                            total=len(callable_tasks),
                        )

                # If we've got task progress update
                progress = tt_data.get("task-progress")
                if progress:

                    # is this progress data from a new task?

c2a47cee1b78a9a629ae6d7bd5ffe18f91b261da

github-actions[bot] commented 2 years ago

Closed in 7d5417d6d96c9c93bfafa936314802a675d1837a