mirror of
https://github.com/iptv-org/iptv
synced 2025-12-16 10:26:48 -05:00
Update scripts
This commit is contained in:
@@ -6,3 +6,4 @@ export * from './issueLoader'
|
||||
export * from './issueParser'
|
||||
export * from './htmlTable'
|
||||
export * from './apiClient'
|
||||
export * from './issueData'
|
||||
|
||||
32
scripts/core/issueData.ts
Normal file
32
scripts/core/issueData.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Dictionary } from '@freearhey/core'
|
||||
|
||||
export class IssueData {
|
||||
_data: Dictionary
|
||||
constructor(data: Dictionary) {
|
||||
this._data = data
|
||||
}
|
||||
|
||||
has(key: string): boolean {
|
||||
return this._data.has(key)
|
||||
}
|
||||
|
||||
missing(key: string): boolean {
|
||||
return this._data.missing(key) || this._data.get(key) === undefined
|
||||
}
|
||||
|
||||
getBoolean(key: string): boolean {
|
||||
return Boolean(this._data.get(key))
|
||||
}
|
||||
|
||||
getString(key: string): string {
|
||||
const deleteSymbol = '~'
|
||||
|
||||
return this._data.get(key) === deleteSymbol ? '' : this._data.get(key)
|
||||
}
|
||||
|
||||
getArray(key: string): string[] {
|
||||
const deleteSymbol = '~'
|
||||
|
||||
return this._data.get(key) === deleteSymbol ? [] : this._data.get(key).split(';')
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Dictionary } from '@freearhey/core'
|
||||
import { Issue } from '../models'
|
||||
import { IssueData } from './issueData'
|
||||
|
||||
const FIELDS = new Dictionary({
|
||||
'Channel ID': 'channel_id',
|
||||
@@ -46,6 +47,6 @@ export class IssueParser {
|
||||
|
||||
const labels = issue.labels.map(label => label.name)
|
||||
|
||||
return new Issue({ number: issue.number, labels, data })
|
||||
return new Issue({ number: issue.number, labels, data: new IssueData(data) })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user