{% if error %}

{{ _("Unable to load activity data") }}

{{ error }}

{% elif not sessions %}

{{ _("No activity found") }}

{{ _("No media sessions found for the selected period") }}

{% else %}
{% for session in sessions %} {% set duration_seconds = session.display_duration_seconds %} {% set duration_str = "" %} {% if duration_seconds %} {% set total_minutes = (duration_seconds // 60) | int %} {% set hours = (total_minutes // 60) | int %} {% set minutes = (total_minutes % 60) | int %} {% if hours > 0 %} {% set duration_str = "{}h {}m".format(hours, minutes) %} {% else %} {% set duration_str = "{}m".format(minutes) %} {% endif %} {% endif %} {% set playback_info = session.get_transcoding_info() %} {% set is_transcoding = playback_info.get("is_transcoding") %} {% set is_direct_play = playback_info.get("direct_play") %} {% set is_remux = (playback_info|length > 0 and not is_transcoding and not is_direct_play) %} {% set video_codec = playback_info.get("video_codec") %} {% set audio_codec = playback_info.get("audio_codec") %} {% set video_resolution = playback_info.get("video_resolution") %} {% set container = playback_info.get("container") %} {% set transcoding_speed = playback_info.get("transcoding_speed") %} {% endfor %}
{{ _("User") }} {{ _("Server") }} {{ _("Media") }} {{ _("Playback") }} {{ _("Device") }} {{ _("Duration") }} {{ _("Started") }}
{{ session.display_user_name }}
{% if session.server_type and session.server_name %} {{ session.server_type|server_name_tag(session.server_name) }} {% else %} {{ _("Unknown") }} {% endif %}
{{ session.media_title }}
{% if session.series_name %}
{{ session.series_name }} {% if session.season_number and session.episode_number %} • S{{ session.season_number }}E{{ session.episode_number }} {% endif %}
{% endif %} {% if session.media_type %} {{ session.media_type }} {% endif %}
{% if is_transcoding %} {% set playback_label = _("Transcoding") %} {% set playback_dot = "bg-orange-500" %} {% set playback_hint = _('Video or audio is being transcoded for this session.') %} {% elif is_remux %} {% set playback_label = _("Remuxing") %} {% set playback_dot = "bg-blue-500" %} {% set playback_hint = _('Container remux without video transcoding.') %} {% elif is_direct_play %} {% set playback_label = _("Direct Play") %} {% set playback_dot = "bg-green-500" %} {% set playback_hint = _('Media is direct playing without conversion.') %} {% else %} {% set playback_label = _("Unknown") %} {% set playback_dot = "bg-gray-400" %} {% set playback_hint = _('Playback method unknown – no stream details reported.') %} {% endif %}
{{ playback_label }} {% if transcoding_speed and is_transcoding %} {{ "%.1f"|format(transcoding_speed|float) }}x {% endif %}
{{ session.device_name or session.client_name or _("Unknown Device") }}
{% if session.is_active and session.started_at %}
00:00
{{ _("Live") }}
{% elif duration_str %}
{{ duration_str }}
{% else %}
{{ _("N/A") }}
{% endif %}
{{ session.started_at|local_date if session.started_at else '-' }}
{{ _("Transcoding") }} {{ _("Remuxing") }} {{ _("Direct Play") }} {{ _("Unknown") }} {{ _("Hover a state for stream details.") }}
{% if total_pages > 1 %}
{{ _("Showing") }} {{ ((page - 1) * 20) + 1 }} {{ _("to") }} {{ ((page - 1) * 20) + sessions|length }} {{ _("of") }} {{ total_count }} {{ _("entries") }} {% from '_partials/macros.html' import numbered_pagination %} {{ numbered_pagination(page, total_pages) }}
{% endif %} {% endif %}