feat(schedule): improve predefined schedule groups

This commit is contained in:
2026-09-08 21:12:08 +03:00
parent a6f6586969
commit f76f33b501
9 changed files with 54 additions and 20 deletions
+7 -1
View File
@@ -1,4 +1,10 @@
GROUP_MAP = {
"central": [
("yandextv", "146"), # pervyy
("yandextv", "587"), # rossya-1
("yandextv", "162"), # ntv
("yandextv", "79"), # sts
],
"sport": [
("matchtv", "matchtv"),
("matchtv", "igra"),
@@ -8,5 +14,5 @@ GROUP_MAP = {
("matchtv", "futbol-3"),
("matchtv", "strana"),
("yandextv", "1799"), # start
]
],
}
+1 -1
View File
@@ -46,7 +46,7 @@ async def get_schedule_index(request: AppRequest, provider: str | None = None, q
return templates.TemplateResponse(
request=request,
name="index.html",
context={"channels": channels},
context={"channels": channels, "groups": GROUP_MAP.keys()},
)
@@ -37,15 +37,14 @@ locale=request.state.language)}}
<thead>
<tr>
<td></td>
<td></td>
<td style="width:100%"></td>
</tr>
</thead>
<tbody>
{% for value in response.values %}
<tr class="{{'d-none' if (live and not value.live) else 'table-success' if (not live and value.live) else ''}}">
<td>
<span>{{value.start.strftime('%H:%M')}}</span>
<span class="small ms-1">({{(value.end - value.start) | timedelta_format}})</span>
<span>{{value.start.strftime('%H:%M')}}</span>&nbsp;<span class="small ms-1">({{(value.end - value.start) | timedelta_format}})</span>
</td>
<td>{{value.label}}</td>
</tr>
@@ -40,15 +40,15 @@
<thead>
<tr>
<td></td>
<td></td>
<td style="width:100%"></td>
</tr>
</thead>
<tbody>
{% for value in response.values %}
<tr class="{{'d-none' if (live and not value.live) else 'table-success' if (not live and value.live) else ''}}">
<td>
<span>{{value.start.strftime('%H:%M')}}</span>
<span class="small ms-1">({{(value.end - value.start) | timedelta_format}})</span>
<span>{{value.start.strftime('%H:%M')}}</span>&nbsp;<span class="small ms-1">({{(value.end - value.start) |
timedelta_format}})</span>
</td>
<td>{{value.label}}</td>
</tr>
@@ -38,7 +38,8 @@
<ul id="channels"
class="list-group mb-5">
{% for channel in channels %}
<schedule-channel channel="{{channel.model_dump() | tojson | forceescape}}"></schedule-channel>
<schedule-channel channel="{{channel.model_dump() | tojson | forceescape}}"
addeable></schedule-channel>
{% endfor %}
</ul>
<hr>
@@ -47,7 +48,9 @@
class="list-group mb-4">
</ul>
<ul class="list-group">
<schedule-channel-group group="sport"></schedule-channel-group>
{% for group in groups %}
<schedule-channel-group group="{{group}}"></schedule-channel-group>
{% endfor %}
</ul>
<script>
(function () {