mirror of
https://github.com/iptv-org/database.git
synced 2024-11-10 06:16:39 -05:00
Merge branch 'master' of https://github.com/AntiPontifex/database
This commit is contained in:
commit
af2785fb2b
4 changed files with 31495 additions and 31337 deletions
2
.github/ISSUE_TEMPLATE/channels_edit.yml
vendored
2
.github/ISSUE_TEMPLATE/channels_edit.yml
vendored
|
@ -84,6 +84,8 @@ body:
|
||||||
options:
|
options:
|
||||||
- 'FALSE'
|
- 'FALSE'
|
||||||
- 'TRUE'
|
- 'TRUE'
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
|
|
4
.github/ISSUE_TEMPLATE/channels_remove.yml
vendored
4
.github/ISSUE_TEMPLATE/channels_remove.yml
vendored
|
@ -6,7 +6,7 @@ labels: ['channels:remove']
|
||||||
body:
|
body:
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: Channel ID
|
label: Channel ID (required)
|
||||||
description: The ID of the channel that should be removed
|
description: The ID of the channel that should be removed
|
||||||
placeholder: 'AnhuiTV.cn'
|
placeholder: 'AnhuiTV.cn'
|
||||||
validations:
|
validations:
|
||||||
|
@ -14,7 +14,7 @@ body:
|
||||||
|
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
attributes:
|
attributes:
|
||||||
label: Reason
|
label: Reason (required)
|
||||||
description: Select the reason for removal from the list below
|
description: Select the reason for removal from the list below
|
||||||
options:
|
options:
|
||||||
- 'Duplicate'
|
- 'Duplicate'
|
||||||
|
|
62801
data/channels.csv
62801
data/channels.csv
File diff suppressed because it is too large
Load diff
|
@ -21,6 +21,7 @@ async function main() {
|
||||||
const filepath = `${DATA_DIR}/channels.csv`
|
const filepath = `${DATA_DIR}/channels.csv`
|
||||||
channels = await csv.fromFile(filepath)
|
channels = await csv.fromFile(filepath)
|
||||||
|
|
||||||
|
await removeChannels()
|
||||||
await editChannels()
|
await editChannels()
|
||||||
await addChannels()
|
await addChannels()
|
||||||
|
|
||||||
|
@ -36,6 +37,26 @@ async function main() {
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
async function removeChannels() {
|
||||||
|
const issues = await fetchIssues('channels:remove,approved')
|
||||||
|
issues.map(parseIssue).forEach(({ issue, channel }) => {
|
||||||
|
if (!channel) {
|
||||||
|
updateIssue(issue, { labels: ['channels:remove', 'rejected:invalid'] })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const index = _.findIndex(channels, { id: channel.id })
|
||||||
|
if (index < 0) {
|
||||||
|
updateIssue(issue, { labels: ['channels:remove', 'rejected:wrong_id'] })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
channels.splice(index, 1)
|
||||||
|
|
||||||
|
processedIssues.push(issue)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async function editChannels() {
|
async function editChannels() {
|
||||||
const issues = await fetchIssues('channels:edit,approved')
|
const issues = await fetchIssues('channels:edit,approved')
|
||||||
issues.map(parseIssue).forEach(({ issue, channel }) => {
|
issues.map(parseIssue).forEach(({ issue, channel }) => {
|
||||||
|
@ -46,7 +67,7 @@ async function editChannels() {
|
||||||
|
|
||||||
const index = _.findIndex(channels, { id: channel.id })
|
const index = _.findIndex(channels, { id: channel.id })
|
||||||
if (!index) {
|
if (!index) {
|
||||||
updateIssue(issue, { labels: ['channels:edit', 'rejected:invalid'] })
|
updateIssue(issue, { labels: ['channels:edit', 'rejected:wrong_id'] })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +79,8 @@ async function editChannels() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
found.id = generateChannelId(found.name, found.country)
|
||||||
|
|
||||||
channels.splice(index, 1, found)
|
channels.splice(index, 1, found)
|
||||||
|
|
||||||
processedIssues.push(issue)
|
processedIssues.push(issue)
|
||||||
|
|
Loading…
Reference in a new issue