diff --git a/tubesync/sync/templates/sync/tasks.html b/tubesync/sync/templates/sync/tasks.html index 9aa61d04..2b7a1250 100644 --- a/tubesync/sync/templates/sync/tasks.html +++ b/tubesync/sync/templates/sync/tasks.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %}{% load humanize %} +{% extends 'base.html' %}{% load humanize %}{% load filters %} {% block headtitle %}Tasks{% endblock %} @@ -56,7 +56,9 @@
-

{{ total_scheduled|intcomma }} Scheduled ({{ scheduled|length|intcomma }} on this page)

+ {% with adjusted=total_scheduled|sub:total_errors %} +

{{ adjusted|intcomma }} Scheduled ({{ scheduled|length|intcomma }} on this page)

+ {% endwith %}

Tasks which are scheduled to run in the future or are waiting in a queue to be processed. They can be waiting for an available worker to run immediately, or diff --git a/tubesync/sync/templatetags/filters.py b/tubesync/sync/templatetags/filters.py index 6762f4c4..444969e9 100644 --- a/tubesync/sync/templatetags/filters.py +++ b/tubesync/sync/templatetags/filters.py @@ -12,3 +12,14 @@ def bytesformat(input): return output return output[: -1 ] + 'iB' +@register.filter(is_safe=False) +def sub(value, arg): + """Subtract the arg from the value.""" + try: + return int(value) - int(arg) + except (ValueError, TypeError): + try: + return value - arg + except Exception: + return "" + diff --git a/tubesync/sync/views.py b/tubesync/sync/views.py index 4c8e672b..3d1896d2 100644 --- a/tubesync/sync/views.py +++ b/tubesync/sync/views.py @@ -858,9 +858,9 @@ class TasksView(ListView): ) sort_keys = ( # key, reverse - ('run_now', True), - ('priority', 'ASC' != order), ('run_at', False), + ('priority', 'ASC' != order), + ('run_now', True), ) data['errors'] = multi_key_sort(data['errors'], sort_keys, attr=True) data['scheduled'] = multi_key_sort(data['scheduled'], sort_keys, attr=True)