Install @freearhey/core

This commit is contained in:
freearhey 2023-09-22 05:17:22 +03:00
parent 03208a262a
commit 4c92b4ecb1
39 changed files with 141 additions and 420 deletions

View file

@ -1,5 +1,6 @@
import { Logger, Storage, Collection } from '@freearhey/core'
import { STREAMS_DIR, DATA_DIR } from '../../constants'
import { Storage, Logger, PlaylistParser, Collection } from '../../core'
import { PlaylistParser } from '../../core'
import { Stream, Playlist, Channel } from '../../models'
import { program } from 'commander'

View file

@ -1,7 +1,6 @@
import { File, PlaylistParser, Storage } from '../../core'
import { Logger, Storage, Collection, File } from '@freearhey/core'
import { PlaylistParser } from '../../core'
import { Stream, Category, Channel, Language, Country, Region, Subdivision } from '../../models'
import { Collection } from '../../core/collection'
import { Logger } from '../../core/logger'
import _ from 'lodash'
import {
CategoriesGenerator,
@ -124,7 +123,7 @@ async function loadStreams({
if (channel.logo) stream.logo = channel.logo
} else {
const file = new File(stream.filepath)
const [_, countryCode] = file.getFilename().match(/^([a-z]{2})(_|$)/) || [null, null]
const [_, countryCode] = file.name().match(/^([a-z]{2})(_|$)/) || [null, null]
const defaultBroadcastArea = countryCode ? [`c/${countryCode.toUpperCase()}`] : []
stream.broadcastArea = new Collection(defaultBroadcastArea)

View file

@ -1,5 +1,6 @@
import { Logger, Storage, Collection, Dictionary } from '@freearhey/core'
import { DATA_DIR, STREAMS_DIR } from '../../constants'
import { Storage, Logger, Collection, Dictionary, IssueLoader, PlaylistParser } from '../../core'
import { IssueLoader, PlaylistParser } from '../../core'
import { Stream, Playlist, Channel, Issue } from '../../models'
let processedIssues = new Collection()

View file

@ -1,4 +1,5 @@
import { Logger, Storage, PlaylistParser, Collection, File, Dictionary } from '../../core'
import { Logger, Storage, Collection, Dictionary, File } from '@freearhey/core'
import { PlaylistParser } from '../../core'
import { Channel, Stream, Blocked } from '../../models'
import { program } from 'commander'
import chalk from 'chalk'