{% if error %}

{{ _("Unable to load now playing") }}

{{ _("There was an error connecting to your media servers") }}

{% elif not sessions %}

{{ _("No one is streaming") }}

{{ _("No active media sessions found across your servers") }}

{% else %}
{% for session in sessions %} {% set progress_percent = (session.progress * 100) | round(1) %} {% set duration = session.duration_ms %} {% set position = session.position_ms %} {% set is_transcoding = session.transcoding_info.is_transcoding %} {% set direct_play = session.transcoding_info.direct_play %}
{% if session.thumbnail_token %}
{% endif %}
{% if session.artwork_token %} {{ session.media_title }} {% else %}
{% endif %}
{{ session.server_type|server_name_tag(session.server_name) }}

{{ session.media_title }}

{{ session.user_name }} • {{ session.client }} ({{ session.device_name }})

{% if is_transcoding %} Transcode {% elif direct_play %} Direct Play {% else %} Direct Stream {% endif %}
{% if position and duration %} {% set pos_seconds = (position // 1000) %} {% set dur_seconds = (duration // 1000) %}
{% if session.state == 'playing' %} {% elif session.state == 'paused' %} {% else %} {% endif %}
{{ (pos_seconds // 60) }}: {% if (pos_seconds % 60) < 10 %}0{% endif %} {{ pos_seconds % 60 }} / {{ (dur_seconds // 60) }}: {% if (dur_seconds % 60) < 10 %}0{% endif %} {{ dur_seconds % 60 }}
{% endif %}
{% endfor %}
{% endif %}