mirror of
https://github.com/iptv-org/iptv.git
synced 2026-11-03 23:23:00 +02:00
fix: normalize playlist:validate file arguments
playlist:validate decides which streams belong to the selected files by comparing the raw command-line arguments with the paths returned by Storage.list(). A path such as ./streams/us.m3u never matches streams/us.m3u, so the file's own streams are put in the duplicate buffer and every link is reported as already being in that same file. Resolve the arguments with getStoragePath(), as playlist:format does.
This commit is contained in:
@@ -4,7 +4,7 @@ import { Storage } from '@freearhey/storage-js'
|
||||
import { PlaylistParser } from '../../core'
|
||||
import { data, loadData } from '../../api'
|
||||
import { ROOT_DIR } from '../../constants'
|
||||
import { isURI } from '../../utils.js'
|
||||
import { getStoragePath, isURI } from '../../utils.js'
|
||||
import { Stream } from '../../models'
|
||||
import * as sdk from '@iptv-org/sdk'
|
||||
import chalk from 'chalk'
|
||||
@@ -34,7 +34,7 @@ async function main() {
|
||||
|
||||
logger.info('loading streams...')
|
||||
const selectedFiles = program.args.length
|
||||
? program.args
|
||||
? program.args.map((filepath: string) => getStoragePath(filepath, ROOT_DIR))
|
||||
: await rootStorage.list('streams/**/*.m3u')
|
||||
const selectedStreams = await parser.parse(selectedFiles)
|
||||
logger.info(`found ${selectedStreams.count()} streams`)
|
||||
|
||||
Reference in New Issue
Block a user