mirror of
https://github.com/iptv-org/iptv
synced 2025-12-17 19:07:37 -05:00
Fix linter issues
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { Logger, Storage, Collection } from '@freearhey/core'
|
import { Logger, Storage, Collection } from '@freearhey/core'
|
||||||
import { ROOT_DIR, STREAMS_DIR, DATA_DIR } from '../../constants'
|
import { ROOT_DIR, STREAMS_DIR, DATA_DIR } from '../../constants'
|
||||||
import { PlaylistParser, StreamTester, CliTable, DataProcessor, DataLoader } from '../../core'
|
import { PlaylistParser, StreamTester, CliTable, DataProcessor, DataLoader } from '../../core'
|
||||||
|
import type { TestResult } from '../../core/streamTester'
|
||||||
import { Stream } from '../../models'
|
import { Stream } from '../../models'
|
||||||
import { program, OptionValues } from 'commander'
|
import { program, OptionValues } from 'commander'
|
||||||
import { eachLimit } from 'async-es'
|
import { eachLimit } from 'async-es'
|
||||||
@@ -92,7 +93,7 @@ async function runTest(stream: Stream) {
|
|||||||
const key = stream.filepath + stream.getId() + stream.url
|
const key = stream.filepath + stream.getId() + stream.url
|
||||||
results[key] = chalk.white('LOADING...')
|
results[key] = chalk.white('LOADING...')
|
||||||
|
|
||||||
const result = await tester.test(stream)
|
const result: TestResult = await tester.test(stream)
|
||||||
|
|
||||||
let status = ''
|
let status = ''
|
||||||
const errorStatusCodes = ['HTTP_404_NOT_FOUND']
|
const errorStatusCodes = ['HTTP_404_NOT_FOUND']
|
||||||
|
|||||||
@@ -6,7 +6,14 @@ import { ProxyParser } from './proxyParser.js'
|
|||||||
import { OptionValues } from 'commander'
|
import { OptionValues } from 'commander'
|
||||||
import { SocksProxyAgent } from 'socks-proxy-agent'
|
import { SocksProxyAgent } from 'socks-proxy-agent'
|
||||||
|
|
||||||
type StreamTesterProps = {
|
export type TestResult = {
|
||||||
|
status: {
|
||||||
|
ok: boolean
|
||||||
|
code: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StreamTesterProps = {
|
||||||
options: OptionValues
|
options: OptionValues
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +44,7 @@ export class StreamTester {
|
|||||||
this.client = axios.create(request)
|
this.client = axios.create(request)
|
||||||
}
|
}
|
||||||
|
|
||||||
async test(stream: Stream) {
|
async test(stream: Stream): Promise<TestResult> {
|
||||||
if (TESTING) {
|
if (TESTING) {
|
||||||
const results = (await import('../../tests/__data__/input/playlist_test/results.js')).default
|
const results = (await import('../../tests/__data__/input/playlist_test/results.js')).default
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ export class BroadcastArea {
|
|||||||
countriesKeyByCode: Dictionary,
|
countriesKeyByCode: Dictionary,
|
||||||
regionsKeyByCode: Dictionary
|
regionsKeyByCode: Dictionary
|
||||||
): this {
|
): this {
|
||||||
let citiesIncluded = new Collection()
|
const citiesIncluded = new Collection()
|
||||||
let subdivisionsIncluded = new Collection()
|
const subdivisionsIncluded = new Collection()
|
||||||
let countriesIncluded = new Collection()
|
const countriesIncluded = new Collection()
|
||||||
let regionsIncluded = new Collection()
|
let regionsIncluded = new Collection()
|
||||||
|
|
||||||
this.codes.forEach((value: string) => {
|
this.codes.forEach((value: string) => {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export class CountriesTable implements Table {
|
|||||||
(logItem: LogItem) => logItem.filepath === `countries/${country.code.toLowerCase()}.m3u`
|
(logItem: LogItem) => logItem.filepath === `countries/${country.code.toLowerCase()}.m3u`
|
||||||
)
|
)
|
||||||
|
|
||||||
let countryItem = {
|
const countryItem = {
|
||||||
index: country.name,
|
index: country.name,
|
||||||
count: 0,
|
count: 0,
|
||||||
link: `https://iptv-org.github.io/iptv/countries/${country.code.toLowerCase()}.m3u`,
|
link: `https://iptv-org.github.io/iptv/countries/${country.code.toLowerCase()}.m3u`,
|
||||||
@@ -77,7 +77,7 @@ export class CountriesTable implements Table {
|
|||||||
logItem.filepath === `subdivisions/${subdivision.code.toLowerCase()}.m3u`
|
logItem.filepath === `subdivisions/${subdivision.code.toLowerCase()}.m3u`
|
||||||
)
|
)
|
||||||
|
|
||||||
let subdivisionItem = {
|
const subdivisionItem = {
|
||||||
index: subdivision.name,
|
index: subdivision.name,
|
||||||
name: subdivision.name,
|
name: subdivision.name,
|
||||||
count: 0,
|
count: 0,
|
||||||
@@ -148,7 +148,7 @@ export class CountriesTable implements Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const undefinedLogItem = logCountries.find(
|
const undefinedLogItem = logCountries.find(
|
||||||
(logItem: LogItem) => logItem.filepath === `countries/undefined.m3u`
|
(logItem: LogItem) => logItem.filepath === 'countries/undefined.m3u'
|
||||||
)
|
)
|
||||||
|
|
||||||
if (undefinedLogItem) {
|
if (undefinedLogItem) {
|
||||||
@@ -170,12 +170,12 @@ export class CountriesTable implements Table {
|
|||||||
item.children
|
item.children
|
||||||
.orderBy(item => item.index)
|
.orderBy(item => item.index)
|
||||||
.forEach(item => {
|
.forEach(item => {
|
||||||
row += `\r\n\ - ${item.name} <code>${item.link}</code>`
|
row += `\r\n - ${item.name} <code>${item.link}</code>`
|
||||||
|
|
||||||
item.children
|
item.children
|
||||||
.orderBy(item => item.index)
|
.orderBy(item => item.index)
|
||||||
.forEach(item => {
|
.forEach(item => {
|
||||||
row += `\r\n\ - ${item.name} <code>${item.link}</code>`
|
row += `\r\n - ${item.name} <code>${item.link}</code>`
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Storage, Collection, File } from '@freearhey/core'
|
import { Storage, Collection } from '@freearhey/core'
|
||||||
import { HTMLTable, LogParser, LogItem } from '../core'
|
import { LogParser, LogItem } from '../core'
|
||||||
import { LOGS_DIR, README_DIR } from '../constants'
|
import { LOGS_DIR, README_DIR } from '../constants'
|
||||||
import { Region } from '../models'
|
import { Region } from '../models'
|
||||||
import { Table } from './table'
|
import { Table } from './table'
|
||||||
|
|||||||
Reference in New Issue
Block a user