mirror of
https://github.com/iptv-org/iptv
synced 2026-10-22 02:56:48 -04: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:
1 parent
8d4f4139f4
commit
867591f3e2
3 files changed
+13
-2
No files matched your search
@@ -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