0
0
mirror of https://github.com/anthonyaxenov/iptv.git synced 2024-11-22 05:24:45 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
b02e68f635
wip 2024-09-22 02:07:47 +08:00
5 changed files with 15 additions and 55 deletions

View File

@ -11,6 +11,7 @@ use App\Exceptions\PlaylistNotFoundException;
*/
class IniFile
{
/**
* @var array
*/

View File

@ -135,7 +135,6 @@ class Playlist
$result = [
'attributes' => [],
'channels' => [],
'groups' => [],
'encoding' => [
'name' => 'unknown',
'alert' => false,
@ -177,7 +176,6 @@ class Playlist
$name = $exploded[1] ?? '(канал без названия)';
}
$channel = [
'_id' => md5($name . random_int(1, 99999)),
'name' => trim($name),
'url' => null,
'group' => $attrs['group-title'] ?? null,
@ -206,22 +204,10 @@ class Playlist
}
}
// if ($groupped) {
$groups = [];
foreach ($result['channels'] as $channel) {
$name = $channel['group'] ?? '<ungroupped>';
$id = md5($name);
if (empty($groups[$id])) {
$groups[$id] = [
'_id' => $id,
'name' => $name,
'channels' => [],
];
if ($groupped) {
$stop = 1;
}
$groups[$id]['channels'][] = $channel['_id'];
}
$result['groups'] = array_values($groups);
// }
return $this->parsedContent = $result;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
{% block title %}{{ title }}{% endblock %}
{% block header %}
<h2>О плейлисте {{ name }}</h2>
<h2>{{ name }}</h2>
{% if (content.encoding.alert) %}
<div class="alert alert-warning small" role="alert">
Кодировка исходного плейлиста отличается от UTF-8.
@ -21,6 +21,7 @@
{% block content %}
<div class="row">
<div class="col-md-7">
<h4>О плейлисте</h4>
<table class="table table-dark table-hover small">
<tbody>
<tr>
@ -57,40 +58,12 @@
<td>Источник</td>
<td>{{ src }}</td>
</tr>
<tr>
<td>Количество каналов</td>
<td>{{ content.channelCount ?? 0 }}</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-5">
<h4>Список каналов</h4>
{# <div class="accordion small bg-dark text-light" id="channels-list">#}
{# {% for group in content.groups %}#}
{# <div class="accordion-item small bg-dark text-light">#}
{# <h2 class="accordion-header small bg-dark text-light" id="heading{{ group._id }}">#}
{# <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{ group._id }}" aria-expanded="true" aria-controls="collapse{{ group._id }}">#}
{# {{ group.name }}#}
{# </button>#}
{# </h2>#}
{# <div id="collapse{{ group._id }}" class="accordion-collapse collapse small bg-dark text-light" aria-labelledby="heading{{ group._id }}" data-bs-parent="#accordion{{ group._id }}">#}
{# <div class="accordion-body">#}
{# <ul class="list-group list-group-flush">#}
{# {% for group in content.channels %}#}
{# <li class="list-group-item">An item</li>#}
{# {% endfor %}#}
{# </ul>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# {% endfor %}#}
{# </div>#}
<h4>Список каналов ({{ content.channelCount ?? 0 }})</h4>
<div class="overflow-auto" style="max-height:500px">
<table class="table table-dark table-hover small">
<tbody>