Update generate.js

This commit is contained in:
freearhey 2021-05-07 19:18:28 +03:00
parent 16b6f2d403
commit 5a2b11104b
1 changed files with 13 additions and 13 deletions

View File

@ -38,7 +38,7 @@ function generateIndex() {
const buffer = []
const channels = db.channels.sortBy(['name', 'url']).all()
for (const channel of channels) {
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -54,7 +54,7 @@ function generateSFWIndex() {
const buffer = []
const channels = db.channels.sortBy(['name', 'url']).sfw()
for (const channel of channels) {
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -82,7 +82,7 @@ function generateCountryIndex() {
for (const channel of unsorted.channels) {
const category = channel.category
channel.category = ''
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -95,7 +95,7 @@ function generateCountryIndex() {
for (const channel of playlist.channels) {
const category = channel.category
channel.category = playlist.country
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -115,7 +115,7 @@ function generateLanguageIndex() {
for (const channel of channels) {
const category = channel.category
channel.category = ''
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -129,7 +129,7 @@ function generateLanguageIndex() {
for (const channel of channels) {
const category = channel.category
channel.category = language.name
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -147,7 +147,7 @@ function generateCategoryIndex() {
const buffer = []
const channels = db.channels.sortBy(['category', 'name', 'url']).all()
for (const channel of channels) {
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -167,7 +167,7 @@ function generateCategories() {
const buffer = []
const channels = db.channels.sortBy(['name', 'url']).forCategory(category).get()
for (const channel of channels) {
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -180,7 +180,7 @@ function generateCategories() {
const channels = db.channels.sortBy(['name', 'url']).forCategory({ id: null }).get()
utils.createFile(other, '#EXTM3U\n')
for (const channel of channels) {
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(other, channel.toString())
buffer.push(info)
@ -200,7 +200,7 @@ function generateCountries() {
const buffer = []
const channels = db.channels.sortBy(['name', 'url']).forCountry(country).get()
for (const channel of channels) {
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -213,7 +213,7 @@ function generateCountries() {
const channels = db.channels.sortBy(['name', 'url']).forCountry({ code: null }).get()
utils.createFile(other, '#EXTM3U\n')
for (const channel of channels) {
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(other, channel.toString())
buffer.push(info)
@ -233,7 +233,7 @@ function generateLanguages() {
const buffer = []
const channels = db.channels.sortBy(['name', 'url']).forLanguage(language).get()
for (const channel of channels) {
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(filename, channel.toString())
buffer.push(info)
@ -246,7 +246,7 @@ function generateLanguages() {
const channels = db.channels.sortBy(['name', 'url']).forLanguage({ code: null }).get()
utils.createFile(other, '#EXTM3U\n')
for (const channel of channels) {
const info = channel.getInfo()
const info = channel.toString()
if (!buffer.includes(info)) {
utils.appendToFile(other, channel.toString())
buffer.push(info)