Merge branch 'master' into be-changes_h

This commit is contained in:
Ismaël Moret
2026-05-07 14:35:22 +02:00
committed by GitHub
78 changed files with 10644 additions and 4694 deletions

View File

@@ -40,8 +40,7 @@ async function main() {
(channel: epgGrabber.Channel) => new Channel(channel.toObject())
)
site.totalChannels += channels.count()
site.markedChannels += channels.filter((channel: Channel) => channel.xmltv_id).count()
site.channels = site.channels.concat(channels)
}
sites.add(site)
@@ -53,8 +52,13 @@ async function main() {
rows.add(
new Collection<HTMLTableDataItem>([
{ value: `<a href="sites/${site.domain}">${site.domain}</a>` },
{ value: site.totalChannels.toString(), align: 'right' },
{ value: site.markedChannels.toString(), align: 'right' },
{
value: site.channels
.uniqBy((channel: Channel) => channel.site_id)
.count()
.toString(),
align: 'right'
},
{ value: site.getStatus().emoji, align: 'center' },
{ value: site.getIssueUrls().all().join(', ') }
])
@@ -66,7 +70,7 @@ async function main() {
rows,
new Collection<HTMLTableColumn>([
{ name: 'Site', align: 'left' },
{ name: 'Channels<br>(total / with xmltv-id)', colspan: 2, align: 'left' },
{ name: 'Channels', align: 'left' },
{ name: 'Status', align: 'left' },
{ name: 'Notes', align: 'left' }
])

View File

@@ -1,5 +1,5 @@
import { Collection } from '@freearhey/core'
import { Issue } from './'
import { Channel, Issue } from './'
enum StatusCode {
DOWN = 'down',
@@ -14,21 +14,18 @@ export interface Status {
export interface SiteData {
domain: string
totalChannels?: number
markedChannels?: number
channels?: Collection<Channel>
issues: Collection<Issue>
}
export class Site {
domain: string
totalChannels: number
markedChannels: number
channels: Collection<Channel>
issues: Collection<Issue>
constructor(data: SiteData) {
this.domain = data.domain
this.totalChannels = data.totalChannels || 0
this.markedChannels = data.markedChannels || 0
this.channels = new Collection()
this.issues = data.issues
}