Добавлено процентное отношение (не)рабочих каналов на страницу плейлиста
This commit is contained in:
@@ -60,14 +60,19 @@ class IniFile
|
|||||||
'attributes' => [],
|
'attributes' => [],
|
||||||
'groups' => [],
|
'groups' => [],
|
||||||
'channels' => [],
|
'channels' => [],
|
||||||
'onlineCount' => 0,
|
|
||||||
'offlineCount' => 0,
|
|
||||||
'checkedAt' => null,
|
'checkedAt' => null,
|
||||||
];
|
];
|
||||||
} elseif (!isset($data['attributes'])) {
|
} elseif (!isset($data['attributes'])) {
|
||||||
$data['attributes'] = [];
|
$data['attributes'] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data['onlinePercent'] = 0;
|
||||||
|
$data['offlinePercent'] = 0;
|
||||||
|
if ($data['isOnline'] === true && count($data['channels'] ?? []) > 0) {
|
||||||
|
$data['onlinePercent'] = round($data['onlineCount'] / count($data['channels'] ?? []) * 100);
|
||||||
|
$data['offlinePercent'] = round($data['offlineCount'] / count($data['channels'] ?? []) * 100);
|
||||||
|
}
|
||||||
|
|
||||||
$data['hasCatchup'] = str_contains($data['content'] ?? '', 'catchup');
|
$data['hasCatchup'] = str_contains($data['content'] ?? '', 'catchup');
|
||||||
$data['hasTvg'] = !empty($data['attributes']['url-tvg'])
|
$data['hasTvg'] = !empty($data['attributes']['url-tvg'])
|
||||||
|| !empty($data['attributes']['x-tvg-url']);
|
|| !empty($data['attributes']['x-tvg-url']);
|
||||||
|
|||||||
@@ -82,10 +82,10 @@
|
|||||||
<th class="text-break">
|
<th class="text-break">
|
||||||
{% if playlist.isOnline is same as(true) %}
|
{% if playlist.isOnline is same as(true) %}
|
||||||
<span class="font-monospace text-success">{{ playlist.code }}</span>
|
<span class="font-monospace text-success">{{ playlist.code }}</span>
|
||||||
<span class="badge small text-dark bg-success">онлайн</span>
|
<span class="badge small text-dark bg-success">online</span>
|
||||||
{% elseif playlist.isOnline is same as(false) %}
|
{% elseif playlist.isOnline is same as(false) %}
|
||||||
<span class="font-monospace text-danger">{{ playlist.code }}</span>
|
<span class="font-monospace text-danger">{{ playlist.code }}</span>
|
||||||
<span class="badge small text-dark bg-danger">оффлайн</span>
|
<span class="badge small text-dark bg-danger">offline</span>
|
||||||
{% elseif playlist.isOnline is same as(null) %}
|
{% elseif playlist.isOnline is same as(null) %}
|
||||||
<span class="font-monospace">{{ playlist.code }}</span>
|
<span class="font-monospace">{{ playlist.code }}</span>
|
||||||
<span class="badge small text-dark bg-secondary" title="Не проверялся">unknown</span>
|
<span class="badge small text-dark bg-secondary" title="Не проверялся">unknown</span>
|
||||||
@@ -116,16 +116,18 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Наполнение</th>
|
<th scope="row">Наполнение</th>
|
||||||
<td class="text-break">
|
<td class="text-break">
|
||||||
<ion-icon name="folder-open-outline"></ion-icon> группы: {{ playlist.groups|length }},
|
<ion-icon name="folder-open-outline"></ion-icon> группы: {{ playlist.groups|length }}<br>
|
||||||
<ion-icon name="videocam-outline"></ion-icon> каналы: {{ playlist.channels|length }}
|
<ion-icon name="videocam-outline"></ion-icon> каналы: {{ playlist.channels|length }}:
|
||||||
(<span class="text-success">{{ playlist.onlineCount }}</span> + <span class="text-danger">{{ playlist.offlineCount }}</span>)
|
<span class="text-success"
|
||||||
|
>{{ playlist.onlineCount }} ({{ playlist.onlinePercent }}%)</span> + <span class="text-danger"
|
||||||
|
>{{ playlist.offlineCount }} ({{ playlist.offlinePercent }}%)</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Возможности</th>
|
<th scope="row">Возможности</th>
|
||||||
<td class="text-break">
|
<td class="text-break">
|
||||||
<ion-icon name="newspaper-outline"></ion-icon> Программа передач: {{ playlist.hasTvg ? 'есть' : 'нет' }}<br>
|
<ion-icon name="newspaper-outline"></ion-icon> Программа передач: {{ playlist.hasTvg ? 'есть' : 'нет' }}<br>
|
||||||
<ion-icon name="play-back"></ion-icon> Перемотка (архив): {{ playlist.hasCatchup ? 'есть' : 'нет' }}
|
<ion-icon name="play-back"></ion-icon> Перемотка (архив): {{ playlist.hasCatchup ? 'есть' : 'нет' }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="text-secondary">
|
<tr class="text-secondary">
|
||||||
@@ -315,7 +317,7 @@
|
|||||||
for="chfOnline"
|
for="chfOnline"
|
||||||
title="Выбрать только онлайн каналы"
|
title="Выбрать только онлайн каналы"
|
||||||
>
|
>
|
||||||
<ion-icon name="radio-button-on-outline"></ion-icon>
|
<ion-icon name="radio-button-on-outline"></ion-icon>{{ playlist.onlineCount }}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input type="radio"
|
<input type="radio"
|
||||||
@@ -329,7 +331,7 @@
|
|||||||
for="chfOffline"
|
for="chfOffline"
|
||||||
title="Выбрать только оффлайн каналы"
|
title="Выбрать только оффлайн каналы"
|
||||||
>
|
>
|
||||||
<ion-icon name="radio-button-on-outline"></ion-icon>
|
<ion-icon name="radio-button-on-outline"></ion-icon>{{ playlist.offlineCount }}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<button type="button"
|
<button type="button"
|
||||||
|
|||||||
Reference in New Issue
Block a user