mirror of
https://github.com/iptv-org/iptv
synced 2025-12-16 18:37:17 -05:00
Update scripts
This commit is contained in:
@@ -73,7 +73,7 @@ export default async function main(filepath: string) {
|
||||
logger.info('creating search index...')
|
||||
const items = channels.map((channel: Channel) => channel.getSearchable()).all()
|
||||
const searchIndex = sjs.createIndex(items, {
|
||||
searchable: ['name', 'altNames', 'guideNames', 'streamNames', 'feedFullNames']
|
||||
searchable: ['name', 'altNames', 'guideNames', 'streamTitles', 'feedFullNames']
|
||||
})
|
||||
|
||||
logger.info('starting...\n')
|
||||
@@ -100,7 +100,7 @@ async function selectChannel(
|
||||
feedsGroupedByChannelId: Dictionary,
|
||||
channelsKeyById: Dictionary
|
||||
): Promise<string> {
|
||||
const query = escapeRegex(stream.getName())
|
||||
const query = escapeRegex(stream.getTitle())
|
||||
const similarChannels = searchIndex
|
||||
.search(query)
|
||||
.map((item: ChannelSearchableData) => channelsKeyById.get(item.id))
|
||||
@@ -108,7 +108,7 @@ async function selectChannel(
|
||||
const url = stream.url.length > 50 ? stream.url.slice(0, 50) + '...' : stream.url
|
||||
|
||||
const selected: ChoiceValue = await select({
|
||||
message: `Select channel ID for "${stream.name}" (${url}):`,
|
||||
message: `Select channel ID for "${stream.title}" (${url}):`,
|
||||
choices: getChannelChoises(new Collection(similarChannels)),
|
||||
pageSize: 10
|
||||
})
|
||||
|
||||
@@ -53,7 +53,7 @@ async function main() {
|
||||
logger.info('sorting links...')
|
||||
streams = streams.orderBy(
|
||||
[
|
||||
(stream: Stream) => stream.name,
|
||||
(stream: Stream) => stream.title,
|
||||
(stream: Stream) => stream.getVerticalResolution(),
|
||||
(stream: Stream) => stream.getLabel(),
|
||||
(stream: Stream) => stream.url
|
||||
|
||||
@@ -129,7 +129,7 @@ async function editStreams({
|
||||
.withChannel(channelsKeyById)
|
||||
.withFeed(feedsGroupedByChannelId)
|
||||
.updateId()
|
||||
.updateName()
|
||||
.updateTitle()
|
||||
.updateFilepath()
|
||||
}
|
||||
|
||||
@@ -173,11 +173,11 @@ async function addStreams({
|
||||
const directives = data.getArray('directives') || []
|
||||
|
||||
const stream = new Stream({
|
||||
channel: channelId,
|
||||
feed: feedId,
|
||||
name: data.getString('channelName') || channel.name,
|
||||
channelId,
|
||||
feedId,
|
||||
title: channel.name,
|
||||
url: streamUrl,
|
||||
user_agent: httpUserAgent,
|
||||
userAgent: httpUserAgent,
|
||||
referrer: httpReferrer,
|
||||
directives,
|
||||
quality,
|
||||
@@ -185,7 +185,7 @@ async function addStreams({
|
||||
})
|
||||
.withChannel(channelsKeyById)
|
||||
.withFeed(feedsGroupedByChannelId)
|
||||
.updateName()
|
||||
.updateTitle()
|
||||
.updateFilepath()
|
||||
|
||||
streams.add(stream)
|
||||
|
||||
Reference in New Issue
Block a user