mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-12 10:00:07 -04:00
Return the old value of replace_by
This commit is contained in:
parent
0fe039a9d6
commit
76fa5d6b46
2 changed files with 3 additions and 5 deletions
|
@ -73,8 +73,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'replaced_by',
|
name: 'replaced_by',
|
||||||
type: 'channel',
|
type: 'string',
|
||||||
value: data._replaced_by ? data._replaced_by.name : null
|
value: data.replaced_by
|
||||||
},
|
},
|
||||||
{ name: 'website', type: 'external_link', value: data.website }
|
{ name: 'website', type: 'external_link', value: data.website }
|
||||||
].filter(f => (Array.isArray(f.value) ? f.value.length : f.value))
|
].filter(f => (Array.isArray(f.value) ? f.value.length : f.value))
|
||||||
|
|
|
@ -33,7 +33,7 @@ export async function fetchChannels() {
|
||||||
|
|
||||||
countries.set(api.countries)
|
countries.set(api.countries)
|
||||||
|
|
||||||
let _channels = Object.values(api.channels).map(c => transformChannel(c, api))
|
let _channels = api.channels.map(c => transformChannel(c, api))
|
||||||
|
|
||||||
channels.set(_channels)
|
channels.set(_channels)
|
||||||
filteredChannels.set(_channels)
|
filteredChannels.set(_channels)
|
||||||
|
@ -134,7 +134,6 @@ async function loadAPI() {
|
||||||
api.channels = await fetch('https://iptv-org.github.io/api/channels.json')
|
api.channels = await fetch('https://iptv-org.github.io/api/channels.json')
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
.then(data => (data.length ? data : []))
|
.then(data => (data.length ? data : []))
|
||||||
.then(data => _.keyBy(data, channel => channel.id.toLowerCase()))
|
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
return []
|
return []
|
||||||
|
@ -163,7 +162,6 @@ export function transformChannel(channel, data) {
|
||||||
channel.is_closed = !!channel.closed || !!channel.replaced_by
|
channel.is_closed = !!channel.closed || !!channel.replaced_by
|
||||||
channel.is_blocked = !!data.blocklist[channel.id]
|
channel.is_blocked = !!data.blocklist[channel.id]
|
||||||
channel.streams = channel._streams.length
|
channel.streams = channel._streams.length
|
||||||
channel._replaced_by = channel.replaced_by ? data.channels[channel.replaced_by.toLowerCase()] : {}
|
|
||||||
|
|
||||||
return channel
|
return channel
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue